m_nathani Posted June 25, 2003 Posted June 25, 2003 hi, How can finde missing number in identity column and insert particular missing number programmaticaly in SQL Server 2000. Quote
*Gurus* Derek Stone Posted June 25, 2003 *Gurus* Posted June 25, 2003 I can't think of a single reason as to why one would need to do that. Nevertheless...SELECT id FROM table Then loop through the returned records to find the "missing" rows. For each missing row execute the following T-SQL: SET IDENTITY_INSERT dbo.tablename ON GO INSERT (id) VALUES (<identity>) INTO dbo.tablename GO ... replacing "<identity>" with the one just found. Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.