Collections:
OFFLINE - Taking a database offline in SQL Server
How to set a database state to OFFLINE in SQL Server?
✍: FYIcenter.com
If you want to move database physical files, you should take the database offline by using the "ALTER DATABASE" statement with the following syntax:
ALTER DATABASE database_name SET OFFLINE
The following tutorial example will bring "FyiCenterComData" offline:
ALTER DATABASE FyiCenterComData SET OFFLINE GO SELECT name, state_desc from sys.databases GO name state_desc master ONLINE tempdb ONLINE model ONLINE msdb ONLINE FyiCenterComData OFFLINE USE FyiCenterComData GO Msg 942, Level 14, State 4, Line 1 Database 'FyiCenterComData' cannot be opened because it is offline.
⇒ Moving Database Physical Files to New Locations in SQL Server
⇐ ONLINE/OFFLINE - Database States in SQL Server
2016-11-20, 2275🔥, 0💬
Popular Posts:
Can Date and Time Values Be Converted into Integers in SQL Server Transact-SQL? Can date and time va...
How to change the data type of an existing column with "ALTER TABLE" statements in SQL Server? Somet...
How To Get Year, Month and Day Out of DATETIME Values in SQL Server Transact-SQL? You can use DATEPA...
How To Format Time Zone in +/-hh:mm Format in SQL Server Transact-SQL? From the previous tutorial, y...
How To Change the Name of a Database User in SQL Server? If you want to change the name of an existi...