Solved

Passing variable to ALTER DATABASE

Posted on 2004-10-08
2
542 Views
Last Modified: 2008-02-01
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

0
Comment
Question by:n0ch1ps
2 Comments
 
LVL 6

Accepted Solution

by:
boblah earned 250 total points
Comment Utility
Hi n0ch1ps,

try

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

Cheers!
0
 
LVL 5

Author Comment

by:n0ch1ps
Comment Utility
ésa es gracias excelentes

n0ch1ps
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now