[dba-SQLServer]basic question

Stuart McLachlan stuart at lexacorp.com.pg
Tue Mar 18 23:09:48 CST 2003


In Enterprise Manager, go into Design Table, deselect "Identity" and save the definition, then open it again and 
re-select it.   Voila!

Note that, unlike Access, you can also re-use deleted Identity values. From BOL:

"By default, data cannot be inserted directly into an identity column. The identity column generates a unique, 
sequential number automatically for each new row inserted in the table. This default can be overridden using 
the following SET statement:  

SET IDENTITY_INSERT table_name ON

With IDENTITY_INSERT set to ON, the user is allowed to insert any value into a new row with an identity 
column. To prevent the entry of duplicate numbers, a unique index must be created against the column. The 
purpose of this statement is to allow a user to re-create a value for a row that has been deleted accidentally.  


On 18 Mar 2003 at 22:48, Antony, Fredrick wrote:

> No Identity is meant for identical value. There is no way of resetting it 
> 
> Regards
> Fred
> 
> -----Original Message-----
> From: Susan Harkins [mailto:harkins at iglou.com]
> Sent: Wednesday, March 19, 2003 6:10 AM
> To: SQLList
> Subject: [dba-SQLServer]basic question
> 
> 
> In Access, a compact will reset the AutoNumber seed value to one more than
> the largest AN value already in the table. Is there anyway to do this with
> an Identity column in SQL Server?
> 
> Susan H.
> 
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
> 
> 
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
> 


-- 
Stuart McLachlan
Lexacorp Ltd
Application Development,  IT Consultancy
http://www.lexacorp.com.pg

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/dba-sqlserver/attachments/20030319/10f22513/attachment.html>


More information about the dba-SQLServer mailing list