Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have some SQL server DBs attached to my instance. The problem is they can easily be copied from the physical folder and any one can attach them to his own instance and view data.

How can I make sure that when files are attached, they can not be copied from the physical location and can be copied only when detached from the instance?

Thanks
Posted
Comments
Basmeh Awad 9-Jul-13 4:07am    
have you tried copying when the files are attached to the server..if the files are attached it dosen't allow you to copy and paste the .mdf file..
i have tried it is not allowing to copy when attached...
Message:Cannot copy test it is being used by another program
Furqan Sehgal 9-Jul-13 5:05am    
Yes, they can be copied without any problem
RedDk 9-Jul-13 12:24pm    
If the instance on which a database is currently being queried is running in a normal ssmse purview, and you try to copy an .mdf file by right-clicking it and selecting "copy" and then "paste" it to desktop you will receive the "File In Use" error message. It goes on to state "The action can't be completed because the file is open in SQL server (<instance>). Close the file and try again." To copy and paste that .mdf go to Computer Managment console find the instance and put a hard STOP on it. Then the .mdf will be offline and moveable. When they're "attached" they can't be copied.

1 solution

 
Share this answer
 
Comments
Furqan Sehgal 9-Jul-13 5:06am    
Thanks Asif but it does not help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900