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
 General SQL Server Forums
 New to SQL Server Administration
 Publish to provider general question

Author  Topic 

kpgraci
Yak Posting Veteran

68 Posts

Posted - 2011-05-04 : 14:24:48
I'm using vs2010 with a user instance sqlexpress 2008 db, and I can use vs2010's server explorers 'publish' wizard to generate a script file of my database, all the tables, indexes and data. I then use sql server managment studio express 2008 to update a sql servr 2008 r2 database on a remote server.

My question: Almost all tables have an auto increment id filed as the PK, and the PK's are used extensivly in the talbes as FK's, so obviously theses IDs need to maintinaed intact...so when I process the script on the remote server does it maintain the ID's as in the source database or do they start over a 1 since the script drops then re-creates the table?


kpg

kpgraci
Yak Posting Veteran

68 Posts

Posted - 2011-05-04 : 14:53:44
I found this in the script:

SET IDENTITY_INSERT [dbo].[Forms] ON

I'm guessing that is what allows the script to preserve the identity data in the target database.

cool


kpg
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-05-04 : 15:01:59
Good guess
Go to Top of Page
   

- Advertisement -