Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My questions seem to be unrelated BUT Windows Explorer might be causing the problem I see when I use SQL Management Studio (Windows 7 64-bit).

a. Recently, since 2 weeks or so ago, my Windows Explorer became less responsive: I can do a copy and paste of a folder for example and do not see the change in W. E. right away. I have to do a manual refresh of the folder to see the change.

b. Now when I rename a database in the MS SQL Management Studio, the underlying database name is NOT changed, even though the name in the Object Explorer is! Before the name of the mdf file was changed by the M.S. When I try to rename the file manually, I get the msg saying "The action can't be completed because the file is open in SQL Server (MSSQLSERVER).

So my question is How do I shut down the SQL Server? I actually shutdown the PC and restarted then try to rename the database file but the same error msg shows up: file is open in SQL Server!

Thanks for any pointer.

share|improve this question
add comment

migrated from stackoverflow.com Jul 6 '11 at 9:43

This question came from our site for professional and enthusiast programmers.

1 Answer

Renaming a database only changes a label. Not the physical file names.

You shut down SQL Server from the Services snap-in. If you did rename the files, then SQL Server won't find then on start up and you'd get a "suspect" error.

MS even wrote a KB article

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.
{"cc_re__cc_re__cc_by_sa_3_0": ["        <li><a href=\"http://area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"http://careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2014 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2014.3.15.1463\r\n            </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Server Fault works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\r\n    </noscr"], "copyright__copyright__copyright": ["11 at 9:43\n\nThis question came from our site for professional and enthusiast programmers.\n\n1 Answer\n\nRenaming a database only changes a label. Not the physical file names.\n\nYou shut down SQL Server from the Services snap-in. If you did rename the files, then SQL Server won't find then on start up and you'd get a \"suspect\" error.\n\nMS even wrote a KB article\n\nshare|improve this answer\nadd comment\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service."]}