Wednesday, September 11, 2013

SQL ALTER DATABASE RESTRICTED Statement


ALTER DATABASE Command:

ALTER DATABASE command as described by Microsoft, a command that modifies a database, or the files and filegroups associated with the database. Adds or removes files and filegroups from a database, changes the attributes of a database or its files and filegroups, changes the database collation, and sets database options. Also it can also modify user permissions.
ALTER DATABASE(T-SQL)

I work with Developers who are constantly working on projects in DEV, QA, and PROD. We have been migrating from SQL 2008 to SQL 2012. Whenever a database is migrated, it is set to 
Setting Database to Single User Mode:

This setting is very useful when you are trying to get exclusive access to database to do the following
  • Restoring Database
  • Deleting Databases
  • Changing Containment Type (SQL 2012)
  • Changing Recovery Model
  • Making changes to database to get exclusive access
The format is very simple

No comments:

Post a Comment