I'm having problems creating a T-SQL stored procedure that creates a new SQL Server 2000 database on the fly from my ASP.NET Web application. I'm trying to pass in a parameter (the name of the database) to the procedure and have my CREATE DABASE DATABASENAME statement receive the value of the parameter. Here is my code:
CREATE PROCEDURE DBO.CREATE DATABASE
@DBNAME VARCHAR (50)
AS
CREATE DATABASE @DBNAME
GO
The procedure works If I hard code the name of the database but not when I pass in the parameter to become the name of the database. Anybody's help is greatly appreciated. Thanks!