Feed on
Posts
Comments

Have you ever been in a situation when you want to set the next value of the identity column? This is s simple task that can be done with DBCC CHECKIDENT statement. This example deleted all records with ID greater than 135 from the table Products. Than it sets the current identity value to 135. Thus when the next record is added it will have ID with value 136.

DELETE  FROM [Products] WHERE id>135
GO

DBCC CHECKIDENT (Products, RESEED, 135)
GO

, , ,
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • dzone
  • Netscape
  • digg
  • YahooMyWeb
  • Technorati

Trackback URI | Comments RSS

Leave a Reply

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

You must read and type the 5 chars within 0..9 and A..F, and submit the form.

  

Oh no, I cannot read this. Please, generate a