| Author |
Message |
ssobolev
Joined: 17 Jul 2008 Posts: 3
|
Posted: Wed Jan 14, 2009 6:19 pm Post subject: Reseed identity columns? |
|
|
I currently have database update procedure implemented using SQL Compare/Data Compare API.
General algorithm is like this:
1. Create new database from script folder using SQL Compare API
2. Fill it with base set of data
3. Compare database structure for new database and existing one;
4. Apply additions to existing database
5. Compare data in existing database with new one using SQL Data Compare API
6. Apply any additions/significant changes to existing database from new one
7. drop temporary database
This process does reset identity seeds on existing database. Is there any way to reseed them properly, whitout using "DBCC CHECKIDENT"? |
|
| Back to top |
|
 |
Ben Pinchen
Joined: 28 Dec 2006 Posts: 157 Location: Red Gate
|
Posted: Mon Jan 19, 2009 6:13 pm Post subject: |
|
|
| Are you using the default SqlOptions enumeration? This includes the option 'Reseed Identity columns'. If you don't want to use this option then you'll have to explicitly call the options that you want to use leaving the option to 'Reseed Identity Columns' out. You can find information about sqloptions from http://help.red-gate.com/help/SQLDataCompareAPIv7/0/en/index.htm |
|
| Back to top |
|
 |
ssobolev
Joined: 17 Jul 2008 Posts: 3
|
Posted: Mon Feb 09, 2009 4:03 pm Post subject: |
|
|
Haven't had the chance to check it with API v7 till today.
It is the same with v6 and v7, if I put in Reseed Identity Column option, it reseeds this column not to the CORRECT value, but to zero.
Here is an example of generated code:
-----------------
-- Reseed identity on [dbo].[Customers]
DBCC CHECKIDENT('[dbo].[Customers]', RESEED, 0)
GO
-----------------
How can I make it to look like
-----------------
-- Reseed identity on [dbo].[Customers]
DBCC CHECKIDENT('[dbo].[Customers]', RESEED)
GO
-----------------
without manually processing SQL code? is there an option to force such reseed ? |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group