Passing variable to ALTER DATABASE

Is it possible to pass a variable to the ALTER DATABASE command?

ALTER DATABSE @dbname ....

If no then is there a way around this?

Thanks

LVL 5
n0ch1psAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
boblahConnect With a Mentor Commented:
Hi n0ch1ps,

try

EXEC('ALTER DATABASE ' + @dbname + '...

Cheers!
0
 
n0ch1psAuthor Commented:
├ęsa es gracias excelentes

n0ch1ps
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.