September 14, 2009 at 12:28 pm
So I have a database I was trying to take OFFLINE, and it hung, so now I can do nothing through the GUI. I thought I'd look up the T-SQL syntax and try again.
BOL shows this:
{ ONLINE | OFFLINE | EMERGENCY }
and:
{
|
|
|
(What does the double colon ::= mean ?)
and:
ALTER DATABASE AdventureWorks
SET ALLOW_SNAPSHOT_ISOLATION ON
making me think the syntax is :
alter database My_Database
set db_state_option offline
(or maybe an '=' sign is needed ?)
But it's wrong. Why can't BOL give an example ?
September 14, 2009 at 12:39 pm
The ::= means "replace this placeholder with one of these options", basically.
Here's the syntax you're looking for:
use master;
go
alter database proofofconcept set offline;
"proofofconcept" is the database name. You'll have to plug in the one you want, of course.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
September 14, 2009 at 12:49 pm
Thanks ..... so where does "db_state_option " fit in ?
September 14, 2009 at 12:51 pm
like mentioned above db_state_option is the placeholder and ::= indicates to replace the placeholder with a valid option.
September 14, 2009 at 1:13 pm
Read this:
http://www.sqlservercentral.com/articles/Books+Online/67607/
or: search this site for 'BNF'
or: Google 'BNF' or 'Backus Naur Form'
Understanding BNF is essential for good info from BOL
-MarkO
"You do not really understand something until you can explain it to your grandmother" - Albert Einstein
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply