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)
 rowcolguid

Author  Topic 

svicky9
Posting Yak Master

232 Posts

Posted - 2006-01-18 : 15:24:18
Hi friends

I created a table as below

create table ex2
(rollno uniqueidentifier default newid() default,
firstname varchar(20))

Then inserted as shown below
insert into table ex2 values('davinci')

but there is an error.
Msg 213, Level 16, State 1, Line 1
Insert Error: Column name or number of supplied values does not match table definition.

how should i insert values into this table??

thanks
Vic

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-01-18 : 15:26:16
insert into table ex2 (firstname) values('davinci')

Tara Kizer
aka tduggan
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-19 : 08:26:43
As Error specifies, number of columns should match. If you dont specify the column list then by default all columns are considered to be inserted. you need to specify the columns if you omit any column

Madhivanan

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

- Advertisement -