Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Changing database to Read_Write Expand / Collapse
Author
Message
Posted Monday, January 28, 2013 2:36 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: 2 days ago @ 10:50 AM
Points: 299, Visits: 1,129
I've a read-only database and I'd like to change it to read_write but the following script never seems to complete. Not sure where I'm going wrong.
USE DatabaseName
go
ALTER DATABASE [DatabaseName] SET READ_WRITE
GO

Is there an alternative method?
Post #1412663
Posted Monday, January 28, 2013 2:44 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 3:37 PM
Points: 312, Visits: 951
You could add "WITH NO_WAIT"
Post #1412668
Posted Tuesday, January 29, 2013 6:48 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 1:57 AM
Points: 1,323, Visits: 1,156
Would [WITH ROLLBACK IMMEDIATE] help?

Andrew
Post #1413014
Posted Tuesday, January 29, 2013 1:02 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: 2 days ago @ 10:50 AM
Points: 299, Visits: 1,129
Andrew Pruski (1/29/2013)
Would [WITH ROLLBACK IMMEDIATE] help?

Andrew


Thanks Andrew. This worked. I'll read further on ROLLBACK IMMEDIATE.
Post #1413277
Posted Tuesday, January 29, 2013 1:09 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 1:57 AM
Points: 1,323, Visits: 1,156
No worries, good link

http://blog.sqlauthority.com/2010/03/17/sql-server-difference-between-rollback-immediate-and-with-no_wait-during-alter-database/

Summary

No Wait - will cause the statement you are executing to fail if there are open transactions
Roll back Immediate - will rollback open transactions when you execute your script (an override I guess)

Andrew
Post #1413287
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse