|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Setting the database to"'use" dynamically...database that was just created in the script...kind of like this: use master go @db varchar(50); begin create database @db go use @db -- DOESNT WORK How do I script this?? Thanks, Ron Most DDL statements cannot take parameters as variables, for a variety of
reasons. http://www.sommarskog.se/dynamic_sql.html Show quote "RSH" <way_beyond_o***@yahoo.com> wrote in message news:ey3BSbq9FHA.3048@TK2MSFTNGP10.phx.gbl... >I am scripting a stored procedure and I need to change the perspective to a >database that was just created in the script...kind of like this: > > use master > go > > @db varchar(50); > begin > > create database @db > go > > use @db -- DOESNT WORK > > > > How do I script this?? > > Thanks, > Ron > > > |
|||||||||||||||||||||||