Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Practice InterviewNew Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

MSSQL Interview Questions and Answers

Ques. How to move database physical files in MS SQL Server?
Ans. If you want to move database physical files to a new location, you can use the "ALTER DATABASE" statements to bring the database offline, and link it to the files at the new location. The following tutorial gives you a good example:

ALTER DATABASE withoutbook SET ONLINE
GO

USE withoutbook
GO

CREATE TABLE Links (Name NVARCHAR(32))
GO

ALTER DATABASE withoutbook SET OFFLINE
GO

Now it is safe to move the database physical files to a new location:

1. Run Windows Explorer
2. Create a new directory: c:tempdata
3. Drag and drop c:tempwithoutbook.mdf to c:tempdata
3. Drag and drop c:tempwithoutbook.mdf to c:tempdata

Go back to the SQL client program and run:

ALTER DATABASE withoutbook
MODIFY FILE (NAME = withoutbookDB,
FILENAME = 'C:tempdatawithoutbookDB.mdf')
GO
Is it helpful? Yes No

Most helpful rated by users:

©2020 WithoutBook