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.
| Author |
Topic |
|
suanleba
Starting Member
1 Post |
Posted - 2009-03-31 : 02:45:38
|
| I have a website developed in visual web developer 2008, there has a database table, a column names APPID is set to primary key, if a record is deleted, it's APPID is saved into another table names Deleted_Table. the question is : if one record is deleted, primary key of the deleted record can not be used when add in a new record, for example, I have total 10 records in my table, if record which primary key is 6 is deleted, when I add in a new record, I'd like use 6 instead of 11 (auto-generated by the system) as the primary key for the new add in record. if I want to reuse the primary key of the very first record in the Deleted_table for a new inserted record all the times, how I can do it? I need details examples. anybody can help me on this.I am really urgent,thanks a lot. |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-03-31 : 03:08:09
|
| dbcc checkident('tablename',reseed,0) |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|
|
|