I'm using Visual Studio 2010 ASP.NET with C# on .NET 4.0 and SQL Server 2008 R2.
I would like to create a database on the server named WINSRV\SQLSRV
.
How do I loop to test for a unique database name?
My default database should be ab
. In case this name is taken, I would like to create a database named ab1
, and if this one is also taken - ab2
and so forth.
I need it to rum from a web page created in the Visual Studio 2010 ASP.NET C# script, and not from the SQL server management studio.
Thanks.