Reputation: 3363
Basically I'm developing an ASP.NET MVC 4 application using EF code first. Now; during my testing I've inserted a lot of annoying rows in my database.
How can I revert back to the initial seed data, discarding all other rows?
Upvotes: 2
Views: 229
Reputation: 19156
If you don't want all of the records, just drop the database. EF Code first will create a new one on the next run. more info
Upvotes: 2
Reputation: 12243
Manually delete the rows from your database. you can reset your ID/Primary key seed with (in SQL Server)
DBCC CHECKIDENT(YourTableName, RESEED, 0)
in your SQL command console from Enterprise Manager/SQL Studio.
Upvotes: 0