Windows non-Admin user and file permissions



Scenario:
a) using local SQL Server Express SP1 instance
b) logged into Windows as a local user who does NOT belong to the Local
Administrators group (BUILTIN\Admin) - just belongs to the "Users" Windows
Group.
c) using SQL standard security, connect to the local Express instance as
'sa'
d) issue a CREATE DATABASE statement specifying the .mdf/.ldf file on my
local "My Documents" folder
e) issue an sp_detach_db command which successfully detaches the database

Issue:
When that user goes out to his "My Documents" folder using Windows Explorer,
the database files (.mdf/.ldf) CANNOT be deleted.. In fact, when viewing
the Properties of these files, there is no "Security" tab!

The user wants to delete those files. How?

The file security behavior appears new for SQL 2005 and is by-design. Some
of the Books Online snippets I found included:
"The SQL Server 2005 Database Engine sets file access permissions on the
physical data and log files of each database to specific accounts. The
permissions prevent the files from being tampered with should they reside in
a directory that has open permissions."

"When a database is created, or modified to add a new file, the MSSQLSERVER
service account and members of the local Administrators group are granted
Full Control access on the data and log files. File access is removed for
all other accounts."


--

Bill


.



Relevant Pages

  • Re: Saving WSS site prior to upgrading SQL Server 2005 Express to Standard/Enterprise
    ... Your backup is from a different version of Windows SharePoint Services and ... SQL Server 2005 is available. ... The advantages of the embedded version ("Windows Internal Database") over ...
    (microsoft.public.sharepoint.windowsservices)
  • IIS / SQL Server impersonation
    ... I am attempting to implement impersonation from a windows application ... I have configured the host virtual directory in IIS to require windows ... the database permits Windows Authentication. ... When I try and open a connection to SQL Server: ...
    (microsoft.public.dotnet.security)
  • Re: User setup problem.
    ... login permissions for SQL Server. ... have access to SQL Server and the database through their ... windows group role membership which has the permissions.. ...
    (microsoft.public.sqlserver.security)
  • Permissions problem on SBS 2003 R2 for SQL Server 2005 clients
    ... involving SQL Server Express 2005 on a Windows SBS 2003 R2 network. ... I've been testing a SQL Server 2005 Express database in a multiuser ... environment using Window Small Business Server 2003 R2 with Windows XP ... On a given client computer to which I may have logged on with Windows ...
    (microsoft.public.windows.server.sbs)
  • RE: Executing a DTS package from a Web application.
    ... >> I’ve been only able to find examples of Windows and VB applications. ... >> to a SQL Server database table. ... The SQL Server database is not local. ... the DTS package specifies the full UNC file name. ...
    (microsoft.public.sqlserver.dts)