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.
| Author |
Topic |
|
feejaz
Yak Posting Veteran
68 Posts |
Posted - 2009-06-13 : 01:32:04
|
| Hi every one,I want to start the table's unique identifier from 1. There was thousands of row in the table that I have just deleted to start from 1. Please let me know the query to start the unique identifier from 1.regards,feejazNavi |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-13 : 03:09:48
|
A UNIQUEIDENTIFIER doesn't "start" with 1.Do you mean an IDENTITY column, or a sequential UNIQUEIDENTIFIER? E 12°55'05.63"N 56°04'39.26" |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-14 : 01:33:49
|
quote: Originally posted by feejaz Hi every one,I want to start the table's unique identifier from 1. There was thousands of row in the table that I have just deleted to start from 1. Please let me know the query to start the unique identifier from 1.regards,feejazNavi
uniqueidentifier stores GUID values. as per your requirement what you need is a identity column which starts from 1. in that case, just use belowALTER TABLE yourtable ADD IDCol int IDENTITY(1,1) |
 |
|
|
jeffreymfischer
Starting Member
10 Posts |
Posted - 2009-10-07 : 11:12:29
|
| I've written a detailed article on an enterprise-ready unique identifier solution.http://blog.scoftware.com/post/2009/08/29/SQL-Server-UniqueIdentifier-Globally-Unique-Globally-Sequential-SOLUTION.aspxRead it and provide feedback.Jeff FischerScoftware Achitect/Developerhttp://blog.scoftware.comScoftware Achitect/Developerhttp://blog.scoftware.com |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
jeffreymfischer
Starting Member
10 Posts |
Posted - 2009-10-13 : 03:37:42
|
| Refer to my blog for help using SQL Server's uniqueidentifier data type.[url]http://blog.scoftware.com/post/2009/08/29/SQL-Server-UniqueIdentifier-Globally-Unique-Globally-Sequential-SOLUTION.aspx[/url]Jeff Fischer |
 |
|
|
|
|
|