August 24, 2005 at 9:45 am
Rather than use the SQL Server 200 Enterprise Manager GUI:
-- I am looking for SQL which will place multiple DB's on a single SQL Server (2000) in Read Only status. (single user mode is not required but if you have that parameter, it will be useful at a later date)
-- Can I execute the SQL from the MASTER DB Query Analyzer session?
August 24, 2005 at 10:59 am
what about
alter database yourdatabase set read_only
?
August 25, 2005 at 7:54 am
You can't set the options on multiple databases in one statement. But you can set multiple options on one database in one statement.
ALTER DATABASE <db> SET READ_ONLY, SINGLE_USER
[ WITH { ROLLBACK IMMEDIATE | NO_WAIT | ROLLBACK AFTER nn SECONDS } ]
Both READ_ONLY and SINGLE_USER settings will be blocked if other users are in the database, the termination clause specifies what to do about them.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply