Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
using "USE dbname" before ALTER DATABASE
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Rick  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 16:07
Newsgroups: microsoft.public.sqlserver.programming
From: Rick <rick0...@verizon.net>
Date: Thu, 5 Nov 2009 08:07:11 -0800 (PST)
Local: Thurs 5 Nov 2009 16:07
Subject: using "USE dbname" before ALTER DATABASE
Still using SQL 2000.

In the examples for ALTER DATBASE in the SQL Books Online they always
execute a USE MASTER before the ALTER DATABASE [dbname]... statement.
Why do they do this?

Also: is there a way to use ALTER DATABASE to just *view* various db
options, the way I previously used sp_dboption?

Thanks for any help.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erland Sommarskog  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 17:57
Newsgroups: microsoft.public.sqlserver.programming
From: Erland Sommarskog <esq...@sommarskog.se>
Date: Thu, 5 Nov 2009 17:57:53 +0000 (UTC)
Local: Thurs 5 Nov 2009 17:57
Subject: Re: using "USE dbname" before ALTER DATABASE

Rick (rick0...@verizon.net) writes:
> Still using SQL 2000.

> In the examples for ALTER DATBASE in the SQL Books Online they always
> execute a USE MASTER before the ALTER DATABASE [dbname]... statement.
> Why do they do this?

I don't think there is any particular reason. Maybe just some good idea
of "best practice". There are some commands that require you to be in
master, for instance grant of server-level permissions in SQL 2005. But
ALTER DATABASE is not one of them.

> Also: is there a way to use ALTER DATABASE to just *view* various db
> options, the way I previously used sp_dboption?

Nope.

--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google