Just as a side note, if you did not want to delete all the data in the
table, you could use
DBCC CHECKIDENT('tablename', RESEED, newidentitytoStartwith)
Ben Miller
----- Original Message -----
From: "Eva Li" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, July 21, 2005 9:38 AM
Subject: Re: [AspNetAnyQuestionIsOk] How to reset AutoNumber (Identity ) in
SQL database
> Thanks a lot!
>
> Eva
>
> Mischa Kroon <[EMAIL PROTECTED]> wrote:
> in sql:
>
> truncate tablename
>
> ----- Original Message -----
> From: "Eva Li" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Thursday, July 21, 2005 3:45 PM
> Subject: [AspNetAnyQuestionIsOk] How to reset AutoNumber (Identity ) in
> SQL
> database
>
>
>> Hi All,
>>
>> Can any body tell me how to reset AutoNumber, i.e. identity value
>> starting
>> from 1?
>>
>> I'd like to clean all the testing data from SQL database and have the
>> identity value
>> start from 1. I used to generate script and recreate tables. I think
>> there should be
>> a way to do this without recreating the table. Any body knows how?
>>
>> Thanks!
>>
>> Eva
>>
>>
>> [Non-text portions of this message have been removed]
>>
>>
>>
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>
>
>
> SPONSORED LINKS
> Programming languages C programming language Computer programming
> languages Java programming language C programming language History of
> computer programming language
>
> ---------------------------------
> YAHOO! GROUPS LINKS
>
>
> Visit your group "AspNetAnyQuestionIsOk" on the web.
>
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
> ---------------------------------
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/