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.
2016-11-20, 674👍, 0💬
Popular Posts:
How To Download Oracle Database 10g XE in Oracle? If you want to download a copy of Oracle Database ...
How to connect SQL Server Management Studio Express to SQL Server 2005 Express in SQL Server? Once y...
What is SQL Server Transact-SQL (T-SQL)? SQL Server Transact-SQL, also called T-SQL, is an extension...
What Is a Parameter File in Oracle? A parameter file is a file that contains a list of initializatio...
How to create new tables with "CREATE TABLE" statements in SQL Server? If you want to create a new t...