Create a data base in sql server 2005 using a stored procedure but database name passed as a parameter
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- php PDO::FETCH_ASSOC doesnt detect select after ba
- Bulk update SQL Server C#
As bitxwise has said, you will need dynamic SQL
That's just the most basic CREATE DATABASE statement. Normally in a production environment, you wouldn't want to have such a proc anyway, and even if you do - you would specify growth, initial size, location etc.
But here's the reference: http://msdn.microsoft.com/en-us/library/ms176061(v=SQL.90).aspx.
Below query block might be helpful.