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 |
|
GRAYWOLF
Posting Yak Master
106 Posts |
Posted - 2008-12-25 : 01:40:51
|
| I have a script that creates a DB from backup...then tests it...Then I am trying to drop it. How do I use a variable as the object DB?DROP DATABASE [@newdbname]DROP DATABASE ''@newdbname''DROP DATABASE @newdbnameDROP DATABASE ''+@newdbname+''None of the above works...---------------------------Working until "the morning sun sets the midnight sky on fire"! |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-25 : 01:44:39
|
| [code]EXEC ('DROP DATABASE' + @newdbname)[/code] |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|