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 |
|
csosa
Starting Member
5 Posts |
Posted - 2009-03-04 : 10:01:55
|
| I have a question. I have deleted all the data I had on my tables. I would like the auto-increment OR the IDENTITY fields to start from 1 again. How can I do this??Thanks in advanceCarlos |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-03-04 : 10:03:38
|
| useDBCC CHECKIDENT() |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
shaggy
Posting Yak Master
248 Posts |
Posted - 2009-03-04 : 10:08:18
|
| DBCC CHECKIDENT ('tablename', RESEED, 0); |
 |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2009-03-04 : 10:10:05
|
| Also, If you deleted all data using truncate,, then identity will be reset on its own. If you ran a delete,, it'd continue from the last id inserted. You'd then have to reseed it. |
 |
|
|
csosa
Starting Member
5 Posts |
Posted - 2009-03-04 : 11:09:05
|
| Thank for the help!I have a couple of questions.Whats the best datatype to use for memo (LONG TEXT) fields?Whats the diference between NCHAR and VARCHAR? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-03-04 : 11:12:37
|
| if using sql 2005 or later, use varchar(max) or nvarchar(max)NCHAR means unicode, it takes twice the storage of char |
 |
|
|
|
|
|