Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-01-30 : 08:35:37
|
| Antonios writes "Hi,I am using Sql Server 2000 and I want to create a new database by assigning the NAME and the FILENAME dynammically. I have created a stored procedure with dbname(the name of the database), dblocation(the place where the database will be stored) as parameters. I keep getting an error, I assume that the type of the parameter is wrong. I cant think of anything else but I cannot figure out the solution as well. I have included the code of the SP, see below:CREATE PROCEDURE [sp_CNDatabase]@dbname nvarchar(5)@dblocation nvarchar(5) ASCREATE DATABASE @dbnameON( NAME = @dbname+'_dat', FILENAME = @dblocation, SIZE = 4, MAXSIZE = 10, FILEGROWTH = 1 )GOthanks in advance for your help,best regards,Antonios Klimis" |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-01-30 : 08:41:10
|
| Take a look at these dynamic SQL articles:http://www.sqlteam.com/item.asp?ItemID=4599http://www.sqlteam.com/item.asp?ItemID=4619You should be able to get your procedure working using the techniques described in these. |
 |
|
|
|
|
|