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 Programming
 Sql AutoNumber

Author  Topic 

johnstern
Yak Posting Veteran

67 Posts

Posted - 2007-05-07 : 14:27:51
I have my id column set to automatically provide and id number, I am wondering if it will be ever be posible that it will give me the value ZERO 0.

( I want to use the lack of the 0 id, as a way to detect that there is need of a new record in a client application)

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-05-07 : 14:31:06
SET IDENTITY_INSERT Table1 ON
INSERT ...
SET IDENTITY_INSERT Table1 OFF

This will allow to to insert 1 (one) value of 0 (zero).


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2007-05-07 : 14:32:48
SQL will not set the value to 0 unless you tell it to. Look at IDENTITY(Property) in BOL(Books OnLine)

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
   

- Advertisement -