Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 28th, 2003, 02:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default Script for restore norecovery, read-only

Hi all,

I notice that EM provides an option to leave a db read-only and able to restore additional logs during a restore. How would I accomplish this with T-SQL? I'm using:

restore database DBName from full_backup with norecovery

I didn't see a read-only attribute in BOL. I want to be able to write the results of each restore operation to a file as I restore the full backup and each individual transaction log.

Also, is there any option in EM for 'stopatmark' to stop the restore at a named transaction.

Seems like half of what I want is avaiable via EM GUI options and the other half requires script.

Thanks for the help.

Bob

 
Old October 28th, 2003, 04:50 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

I don't think you can do it from the RESTORE command. But, you can set the database READ_ONLY property with the ALTER DATABASE SET <optionspec> command. You can also use the system stored procedure sp_dboption, but its use is deprecated as of SQL Server 2000.

I'm not aware of any option in EM to handle named marks in the log.

Quote:
quote:
Seems like half of what I want is avaiable via EM GUI options and the other half requires script.
Nothing's perfect :(

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old October 29th, 2003, 12:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Thanks Jeff,

ALTER DATABASE <dbname> SET READ_ONLY WITH ROLLBACK IMMEDIATE

seems like a way to go. I'll give it a whirl.

Bob






Similar Threads
Thread Thread Starter Forum Replies Last Post
Restore umeshtheone SQL Server 2000 1 July 12th, 2007 07:38 AM
How to read parent Package in Script Task rarediamond25 SQL Server 2005 3 April 12th, 2007 10:01 AM
Backup and Restore acko SQL Server 2000 0 July 1st, 2004 03:18 AM
Restore problem Adam H-W SQL Server 2000 1 June 3rd, 2004 05:05 AM
Call and run CGI script from a PHP script ... how? dbruins BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 June 10th, 2003 03:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.