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 |
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2007-08-03 : 14:42:47
|
| [code]beginset identity_insert SpProductionDB.dbo.TSTD_ShortTermDisabilityCheck oninsert into SpProductionDB.dbo.TSTD_ShortTermDisabilityCheckselect * from SpProductionDBBak.dbo.TSTD_ShortTermDisabilityCheckset identity_insert SpProductionDB.dbo.TSTD_ShortTermDisabilityCheck offend[/code]Why does this not work, I am getting this error**Msg 8101, Level 16, State 1, Line 3An explicit value for the identity column in table 'SpProductionDB.dbo.TSTD_ShortTermDisabilityCheck' can only be specified when a column list is used and IDENTITY_INSERT is ON.** |
|
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2007-08-03 : 14:44:51
|
| Turns out I just needed to write out the column names |
 |
|
|
KenW
Constraint Violating Yak Guru
391 Posts |
Posted - 2007-08-03 : 16:19:01
|
For future reference,quote: an only be specified when a column list is used
Means that you need to write out the column names. |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2007-08-06 : 07:15:25
|
| Can we add this to our collection of "Why you do NOT use 'Select *'" ?[Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
pootle_flump
1064 Posts |
Posted - 2007-08-06 : 09:57:44
|
quote: Originally posted by DonAtWork Can we add this to our collection of "Why you do NOT use 'Select *'" ?
It could have been worse - there might not have been an identity column and it might have worked |
 |
|
|
|
|
|