November 28, 2003 at 6:38 am
One thing I came across today...
When SQL Server is running and no sql activity is being done on any of the databases, any one with delete rights can delete the mdf/ldf files?
I was under the impression that sql server does not allow to delete/move the data/log files of the databases attached to it!!!
I do understand that the rights are applied by the OS and not the SQL Server.
But still can the data/log files be deleted when not in use?
Sachin
Regards,
Sachin Dedhia
November 28, 2003 at 7:05 am
alter database pubs remove file pubs_data2. For details, see BOL.
Make sure the file you are going to remove is empty.
November 28, 2003 at 7:46 am
I'm not sure if I understand the question correctly, but when the SQL Server service is running, it locks the physical files so that no one can delete/alter the files through the OS (eg windows explorer). This is true, I believe, even when there is no activity within SQL Server itself.
However, if the SQL Server service is not running then anyone can delete/rename the files through the OS (assuming that they have appropriate OS permission to do so).
Jeremy
November 28, 2003 at 7:50 am
You can also modify the file name or even delete it when the database is offline
No matter if services run or not
Frank
Edited by - Frank kalis on 11/28/2003 07:50:52 AM
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
November 28, 2003 at 12:59 pm
If you have a database set to AUTOCLOSE (the default for SQL Personal Edition, but needing to be explicitly set for other editions) then yes, when the last user has disconnected, the mdf/ldf files will be closed and available for anyone with appropriate permissions to manipulate.
Cheers,
- Mark
Cheers,
- Mark
November 29, 2003 at 6:01 am
Thanks Mark, it works. Previously I did not get any such problem. But now I am working on Personal Edition and Desktop Edition (MSDE) and as u say....
Sachin
🙂
Regards,
Sachin Dedhia
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply