I have deleted all my old table entries i want to reset The UserID (primary key) column of my table in Visual Studio 2010. Kindly guide how to do that.
Asked
Active
Viewed 922 times
-2

abatishchev
- 98,240
- 88
- 296
- 433

Sana Zehra
- 25
- 1
- 6
-
TRUNCATE the table to delete all entries and reset the identity at the same time. – Malk Mar 18 '12 at 15:43
-
@Malk: where to write this TRUNCATE statement in Vs 2010 environment?? – Sana Zehra Mar 18 '12 at 16:14
2 Answers
0
You need to be able to run a sql statement (and have proper permissions for it to execute).
DBCC CHECKIDENT
(
table_name
[, { NORESEED | { RESEED [, new_reseed_value ] } } ]
)
[ WITH NO_INFOMSGS ]
-
If you post code, XML or data samples, **PLEASE** highlight those lines in the text editor and click on the "code samples" button ( `{ }` ) on the editor toolbar to nicely format and syntax highlight it! – marc_s Mar 18 '12 at 15:35
-1
Visual Studio Server Explorer is just a client. You want to reset identity column value, in server table. Do you fill the difference?! Say between Email and Outlook, Internet and Firefox?
(I hope I've gave you a good enough tip what to google for)

abatishchev
- 98,240
- 88
- 296
- 433
-
no not in server table it goes like Server explorer>Database>Tables>Registration(thats My table name) and there is a column in this table UserId which has been set as a primay key ... i want to **reset** its value back to 1 .. how can i do that in **VS 2010 Environment**?? – Sana Zehra Mar 18 '12 at 16:13