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 |
|
Frances
Starting Member
20 Posts |
Posted - 2005-02-16 : 06:04:15
|
| Hi all,does anyone know how I can make a stored which creates a database with a name that I specify as a variable?Example:CREATE PROC Create_Database (@name varchar(100))ASCREATE DATABASE @nameGOUnfortunately, the '@name' isn't accepted... Any ideas?Thank you :) |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-02-16 : 06:06:59
|
try:exec('CREATE DATABASE ' + @name)Go with the flow & have fun! Else fight the flow |
 |
|
|
Frances
Starting Member
20 Posts |
Posted - 2005-02-16 : 06:20:40
|
Thanks very much, that works like a charm Thank you |
 |
|
|
|
|
|