•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 427,776 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,725 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 2189 | Replies: 0
![]() |
| |
•
•
Join Date: Oct 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hi ,
I use MSsql server 2005 with the compatability mode set to 2000.One of the tables, has an IDENTITY Column.I need to restore a earlier backed copy of the table.So, i did the following :
set IDENTITY_INSERT MYTABLE ON
insert into MYTABLE(ID,NAME) values(23,'XYZ')
However, i get the following error :
[Error Code: 544, SQL State: S0001] Cannot insert explicit value for identity column in table 'MYTABLE' when IDENTITY_INSERT is set to OFF.
Can anyone tell me why the set IDENTITY_INSERT does not work ? I need to disable the IDENTITY, do the restore and then enable the IDENTITY again.Also, i need to be able to do this only thorugh SQL issued via JDBC.Please help.
Thanks,
Charu.
I use MSsql server 2005 with the compatability mode set to 2000.One of the tables, has an IDENTITY Column.I need to restore a earlier backed copy of the table.So, i did the following :
set IDENTITY_INSERT MYTABLE ON
insert into MYTABLE(ID,NAME) values(23,'XYZ')
However, i get the following error :
[Error Code: 544, SQL State: S0001] Cannot insert explicit value for identity column in table 'MYTABLE' when IDENTITY_INSERT is set to OFF.
Can anyone tell me why the set IDENTITY_INSERT does not work ? I need to disable the IDENTITY, do the restore and then enable the IDENTITY again.Also, i need to be able to do this only thorugh SQL issued via JDBC.Please help.
Thanks,
Charu.
![]() |
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- MSSQL 2005 Express Restore Backup Issue (MS SQL)
- DTS on MSSQL 2005 Express edition (MS SQL)
- backup script for a table in MSSQL 2005 (MS SQL)
- ORDER BY - join column (MS SQL)
- connecting VC++ w/ MSSQL 2005 (C++)
- SQL 2005 won't start after critical update reboot (MS SQL)
- Dropped User from Run as Service (Windows NT / 2000 / XP / 2003)
Other Threads in the MS SQL Forum
- Previous Thread: How to enumerate server instance in local server
- Next Thread: estimate size?


Hybrid Mode