Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Creating A One Column Table

Author  Topic 

UnathiM
Starting Member

8 Posts

Posted - 2006-08-22 : 03:48:01
Hi

I want to create a table with ine column and insert navues into that column.I have tried and failed. Can anyone help me?

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-08-22 : 03:51:45
[code]
Create Table TabName
(
Col1 varchar(10)
)
GO
Insert TabName
Select 'Test'

Select * From TabName
[/code]

Its always good to post what you have tried, so that some one over here can correct your mistake and which will help you for better understanding.

Chirag
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-08-22 : 04:15:10
If you mean you have one column table and you want to insert default value without explicitly stating it, then you can do following:

INSERT TBL DEFAULT VALUES


provided either column allows nulls or have default bound with it.

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-26 : 05:19:45
quote:
Originally posted by UnathiM

Hi

I want to create a table with ine column and insert navues into that column.I have tried and failed. Can anyone help me?


What have you tried?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -