|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 6:26 PM
Points: 263,
Visits: 866
|
|
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?
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: 2 days ago @ 4:29 PM
Points: 134,
Visits: 406
|
|
| You could add "WITH NO_WAIT"
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 6:37 AM
Points: 841,
Visits: 495
|
|
Would [WITH ROLLBACK IMMEDIATE] help?
Andrew
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 6:26 PM
Points: 263,
Visits: 866
|
|
Andrew Pruski (1/29/2013) Would [WITH ROLLBACK IMMEDIATE] help?
Andrew
Thanks Andrew. This worked. I'll read further on ROLLBACK IMMEDIATE.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 6:37 AM
Points: 841,
Visits: 495
|
|
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
|
|
|
|