db recreate option not working ?  
Author Message
nojetlag





PostPosted: Visual Studio Team System - Database Professionals, db recreate option not working ? Top

I have a project that creates a db with two tables each of them has an identity field for the ID,however when deploying the project 2-3 times the identity gets counted upwards. I do have set the option to "always recreate database", I was expecting that this deletes the db and therefore set the identity fields back to start, no

Visual Studio Team System33  
 
 
Gert Drapers





PostPosted: Visual Studio Team System - Database Professionals, db recreate option not working ? Top

That is certainly the intend of the property. I tried creating a similar project with two tables, both having a PK on an identity column, but I do not seem to be able to reproduce your problem. Is it possible for you to ZIP up your project and email it to me gert dot drapers at microsoft dot com

Thanks in advance for the cooperation,
-GertD
"DataDude" Development Manager


 
 
Dmitriy_Nikonov_MSFT





PostPosted: Visual Studio Team System - Database Professionals, db recreate option not working ? Top

Dear Nojetlag,

I've tried to reproduce the problem using the files you've sent to GertD, and was not able to do that. The identity was reset on every successful deployment.

HOWEVER, when target database is in use (i.e. you have an open SSMS query windows against it, etc) Deployment fails (there is a message about it), because TargetDB cannot be dropped. In this case, for obvious reasons, identity is not reset.

I may be missing some steps in the process, so if you are still having the problem, can you, please send me the detailed steps to reproduce the problem (i.e. Open the project, Click Deploy, etc).

Thank you for your help,