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: Friday, September 19, 2014 1:03 PM
Points: 298, Visits: 1,104
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
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Sunday, August 31, 2014 11:45 AM
Points: 275, Visits: 863
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: Today @ 4:19 PM
Points: 1,231, Visits: 1,005
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: Friday, September 19, 2014 1:03 PM
Points: 298, Visits: 1,104
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: Today @ 4:19 PM
Points: 1,231, Visits: 1,005
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