Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

identity column Expand / Collapse
Posted Monday, November 5, 2012 8:17 AM


Group: General Forum Members
Last Login: Thursday, February 21, 2013 12:01 PM
Points: 149, Visits: 346

my identity column should start with 1,1 .

but when i insert data from package , it starts 1133.

even if i drop table and create again and insert data from package,it starts with 1133

any help
Post #1381106
Posted Monday, November 5, 2012 8:19 AM



Group: General Forum Members
Last Login: Thursday, September 1, 2016 2:56 AM
Points: 5,969, Visits: 6,067
Check the source where the data is coming from in the package and your transformations, if your inserting a column from the source into the identity column in the destination it will take what ever the values are from the source, it wont start from 1.

Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1381107
Posted Monday, November 5, 2012 6:04 PM

Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, November 14, 2016 4:53 AM
Points: 370, Visits: 1,252
Check the initial value before the insert:

If it is not 1, your creation script has initial value that is not 1.

To reset identity to start from 1 use this:

But it is better to fix the creation script.

Microsoft Certified Master: SQL Server 2008
XDetails Addin - for SQL Developers - Transaction log myths
Post #1381331
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse