Solved

Passing variable to ALTER DATABASE

Posted on 2004-10-08
2
550 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
ID: 12257993
Hi n0ch1ps,

try

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

Cheers!
0
 
LVL 5

Author Comment

by:n0ch1ps
ID: 12258080
ésa es gracias excelentes

n0ch1ps
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

773 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