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 |
|
vasu4us
Posting Yak Master
102 Posts |
Posted - 2006-08-31 : 17:20:56
|
| I have 2 tables with same structure.only difference is, TableA has key colum which is declared as identity starting from 1.I want to insert data from TableB into TableA where TableB.Key is all null with TableA.Key starting from 9000001when i try to do that iam getting an error"An explicit value for the identity column in table 'lEADlOAN' can only be specified when a column list is used and IDENTITY_INSERT is ON."even when I turned IDENTITY_INSERT ON for TableA |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-08-31 : 17:31:17
|
| Post the code that you have tried.Tara Kizer |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-09-01 : 03:43:41
|
I am not sure I am clear about what you want?What is the purpose of updating TableA's key column with key from TableB when TableB's key is all NULL?BTW, if you are getting error even after identity_insert is on, then you might not be specifying column list like,insert into TableA(col1, col2) select col1, col2 from TableB Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
|
vasu4us
Posting Yak Master
102 Posts |
Posted - 2006-09-01 : 14:37:47
|
| hay thanks one prob was i was not specifing the col list in the select and that identity column in tableA was also primary key i droped the constraints and populated the TableB keycol with different set of idsand it workedsorry i may not be clear....but i solved the problem |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-09-01 : 14:50:06
|
quote: Originally posted by vasu4us...i droped the constraints...
Constraints can be very annoying.CODO ERGO SUM |
 |
|
|
|
|
|