Solved

Passing variable to ALTER DATABASE

Posted on 2004-10-08
2
554 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL SERVER - Index skipped a number 2 25
Error when creating an UPDATE Trigger in SQL 6 18
Query for timesheet application 3 17
SQL Group By Question 4 18
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

809 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