Creating non-trivial database on SQL Server on request

cragreevenusa

New Member
I am facing a problem with slow new database creation using 17000 lines of code long script sent from ASP.NET as a batch, in one command. Problem is that execution of this script takes 20s sometimes more during peak times. If I run this script in SQL Server Management Studio, it takes 2s.What is the best practice to create databases on request, put script into a stored procedure, database cloning, pre-creation and than renaming of DB? We need to be sure it is compatible with concurrent environment under load.Thank you.
 
Back
Top