Results 1 to 2 of 2
  1. #1
    manik's Avatar
    manik is online now Om Shanti!
    Join Date
    Apr 2008
    Location
    Boston, USA
    Posts
    13,175
    Thanks
    744
    Thanked 699 Times in 550 Posts
    Blog Entries
    4
    Feedback Score
    4 (100%)

    Default Reset Identity Column - Microsoft SQL

    Reset Identity Column - Microsoft SQL

    Sometimes after deleting all the rows in a table you want to get the identity column set to 0 so next row you would add starts at identity column value of 1.

    Here is an example sql code that would reset table myTable identity column to 0; so next row you insert would have identity column of 1.

    DBCC CHECKIDENT('myTable', RESEED, 0)
    Free Classified Ads & BUSINESS/PROFESSIONAL SOCIAL NETWORK


  2. #2
    RichardFrench's Avatar
    RichardFrench is offline Freshman
    Join Date
    Feb 2012
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Feedback Score
    0

    Default

    Nice, simple tip. Thanks

Similar Threads

  1. Set Identity Insert On Off - Microsoft SQL
    By manik in forum Databases
    Replies: 3
    Last Post: 04-05-2011, 02:08 AM
  2. Replies: 1
    Last Post: 04-05-2011, 01:26 AM
  3. Get Column Names of Table - Microsoft Sql
    By manik in forum Databases
    Replies: 0
    Last Post: 03-02-2011, 05:08 PM
  4. Alter Table Column as Identity - MS SQL
    By manik in forum Databases
    Replies: 1
    Last Post: 10-21-2010, 03:46 AM
  5. How to Check if a Column is Identity - MS SQL
    By manik in forum Databases
    Replies: 0
    Last Post: 05-28-2010, 10:33 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Partners: BOSTON WEB DEVELOPER, LLC   |   WEBCOSMO CLASSIFIEDS