Thanks for all the suggestions. I've replied to an earlier post to avoid
nesting too deep. Securtiy is something I don't know a lot about but the SQL
Server Express permissions appear to have a lot of problems as explained
later. I did turn off the basic security in Norton Internet Security but I
didn't turn off the User Account Control as I didn't know how to do this and
I was focused on the permissions issues. The steps I took are as follows:
1) Checked the "Local Users and Groups" in "Comptuer Management".
Only the following users are defiined:
Administrator
Daniel
Guest
IUSR_DMGMAIN2008
There are a bunch of groups including 8 for SQL Server such as:
SQLServer2005MSSQLUser$DMGMAIN2008$MSSQLSERVER
SQLServer2005MSSQLUser$DMGMAIN2008$SQLEXPRESS
2) Checked the directory permissions for the original "C:\DevNet2008\Data"
directory.
Groups or users listed under security are:
Authenticated Users
SYSTEM
Administrators (DmgMain2008\Daniel\Administrators)
Users (DmgMain2008\Daniel\Users)
The "Admistrators" and "SYSTEM" have all permissions except "Special" and
"Authenticated Users" lacked "Full control" as well.
3) Created another "Northwind" database in the default server directory.
Created "Northwind" DB in the following directory using the unmodified
"instnwnd.sql" script :
c:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\DATA
This directory included full control permissions for
"SQLServer2005MSSQLUser$DMGMAIN2008$SQLEXPRESS" but got the same error as did
for the original "C:\DevNet2008\Data" directory. The "northwnd.mdf" file
permissions included this same setting.
4) Checked permissions for some databases.
I deleted the "Northwind" files and recreated the database as above. The
permissions under "Database Properties" had no "Users or roles" listed and
just a link to "server permissions" which I explored in the next step.
The permissions for the "model" database was the same as for "Northwind" but
the permissions for "master" included "##MS_AgentSigningCertificate##" and
"guest" under "Users or roles" but clicking on the "Effective Permissions"
button resulted in a similar "can't access" error to the one listed under the
next step but with error number 15517.
5) Right clicked on instance "DMGMAIN2008\SQLEXPRESS (SQL Server 9.0.3054 -
DmgMain2008\Daniel)" in SSMS and selected "Properties" then "Permissions" in
the "Server Properties" window.
There are a whole bunch of "logins or roles" including four with "##" at the
start of the name such as:
##MS_SQLAuthenticatorCertificate##
Tthe other logins or roles are:
BUILTIN\Administrators
BUILTIN\Users
DmgMain2008\Daniel
DMGMAIN2008\SQLServer2005MSSQLUser$DMGMAIN2008$SQLEXPRESS
NT AUTHORITY\SYSTEM
The list of permissions for all these latter roles contain 25 permissions
for the grantor "DmgMain2008\Daniel" with nothing checked and a duplicate
entry for "Connect SQL" for grantor "sa" with "Grant" checked. Clicking the
"Effective Permissions" buttons shows all 25 permissions for the following
logins or roles:
DmgMain2008\Daniel
NT AUTHORITY\SYSTEM
Clicking this button for all other logins or roles including the four with
"##" at the start of the name results in the following error:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Cannot show requested dialog.
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
------------------------------
Cannot execute as the server principal because the principal
"DMGMAIN2008\SQLServer2005MSSQLUser$DMGMAIN2008$SQLEXPRESS" does not exist,
this type of principal cannot be impersonated, or you do not have permission.
(Microsoft SQL Server, Error: 15406)
For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=0...0.3054&
------------------------------
BUTTONS:
OK
------------------------------
>> Stay informed about: SQL Server 2005 can't attach database on Windows Vista