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)
 SET IDENTITY_INSERT

Author  Topic 

smccreadie
Aged Yak Warrior

505 Posts

Posted - 2001-05-24 : 14:34:21
I'm working on a go-live script for an application that we're migrating from MSAccess to a MSAccess front-end and SQL7 backend. The script is set up to create all the tables, sprocs, permissions, defaults, etc. in a clean database then copy over the data.

Many of the tables have an identity field. Using the code:

SET IDENTITY_INSERT pharmdata.dbo.tbl_tbldisp_units ON

Insert into tbldisp_units (disp_units_code, disp_units)
Select disp_units_code, disp_units from pharmdata.pharmdat_temp.dbo.tbldisp_units
go
, I get the following error:

Table 'pharmdata.dbo.tbl_tbldisp_units' does not exist or cannot be opened for SET operation.

The table does exist because it was created in the script earlier.

Any ideas how to get around this?

   

- Advertisement -