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 |
|
skillile
Posting Yak Master
208 Posts |
Posted - 2001-12-13 : 11:14:54
|
| After deleting all the records in a tablewith a primary key.How do you reset the key value to 1 withoutdroping it and recreating it.slow down to move faster... |
|
|
shankarc
Starting Member
37 Posts |
Posted - 2001-12-13 : 11:40:23
|
| On the assumption that your Primary key is an Identity column, i am continuing....You can use Truncate Table instead of Delete.TRUNCATE TABLE removes all rows from a table, but the table structure and its columns, constraints, indexes and so on remain. "The counter used by an identity for new rows is reset to the seed for the column. "So just set your seed to 1 and use Truncate table. |
 |
|
|
izaltsman
A custom title
1139 Posts |
Posted - 2001-12-13 : 11:40:53
|
| You mean an identity column? See DBCC CHECKIDENT in BOL |
 |
|
|
|
|
|