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.
Author |
Topic |
dbalearner
Constraint Violating Yak Guru
272 Posts |
Posted - 2012-08-26 : 21:37:41
|
Couldn't find any evidence why it is not inserting the record.Msg 213, Level 16, State 1, Line 1Column name or number of supplied values does not match table definition.Many Thanks |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-26 : 21:49:45
|
its obvious. you're not passing values as per table definition. either one of columns is missing a value in values list or column itself is missing in columns listto be safe use syntax like INSERT Tablename(col1,col2,col3...) VALUES (value1,value2,value3,...)------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
dbalearner
Constraint Violating Yak Guru
272 Posts |
Posted - 2012-08-27 : 18:12:47
|
I have followed the same suggested instead still giving the same error.Already the Same table Structure has been copied out and created with different name and tried to insert but couldn't find the matching ! |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2012-08-27 : 18:38:51
|
Post the Schema and Insert Statement.-Chad |
|
|
dbalearner
Constraint Violating Yak Guru
272 Posts |
Posted - 2012-08-28 : 21:11:26
|
The Schema is same as of other table.Trying to Insert into Same structure table as CART_TAB from one database to another.insert into [dc-sql-01].[I14_CorruptTreat].dbo.cart_tab Select * from CART_Tabwhere ridquotient ='000000700097' and uidMaster = '0001096487:01010:00071' and service ='TREK' and Deleted =0 order by RecordNumsThe columns above were on referential integrity and other columns were allowed.till Otherday could able to insert but all of sudden it is now with the error. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-28 : 21:50:49
|
quote: Originally posted by dbalearner The Schema is same as of other table.Trying to Insert into Same structure table as CART_TAB from one database to another.insert into [dc-sql-01].[I14_CorruptTreat].dbo.cart_tab Select * from CART_Tabwhere ridquotient ='000000700097' and uidMaster = '0001096487:01010:00071' and service ='TREK' and Deleted =0 order by RecordNumsThe columns above were on referential integrity and other columns were allowed.till Otherday could able to insert but all of sudden it is now with the error.
replace * on the select with actual columns------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|