I need to rename a databases data file. Is this possible through SQL Server Management Studio?
FYI, I do not have permissions to the underlying box.
Edit: I also need to change the location of the file.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you can do this, as long as you have the right to detach and re-attach the database, and as long as you find a way to physically rename the files on disk:
1) issues these commands
(as DGGenuine pointed out in a comment: the ‘your-new-file-on-disk.mdf’ must be a full file name – including path – on your disk)
2) detach the database
3) rename the files on disk
4) re-attach the database again