Who is the default owner for sql express in windows authentication mode?


If i create a database in sql express in windows authentication mode, the database owner is in the format of 'MACHINENAME\USERNAME'. If i connect this database to iis server i got login failed error message.

This is my connection string in my web.config :
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=dbsgh;Data Source=software92\sqlexpress

I solved this problem by creating a login in sqlexpress called 'software92/aspnet' and creating a user for my database named aspnet under 'software92/aspnet' login. Then i changed the usrename in directory security of my iis virtual directory to 'software92/aspnet'.
This solves my problem. But i think i m solving this problem in a wrong way.
I think i should create that database under default owner. Who is the default owner?

I dont know the correct procedure to solve this.
Please help.

[953 byte] By [Aswin] at [2008-1-7]
# 1

Default owner of a database is typically the creator of the database which is a login. The Default Owner (called Dbo) is the sysadmin for the database which is the most powerful user in a database. You do not want your web app connecting as the Dbo but as a dedicated user like the one you created which minimal permissions. What you did was setup a new account for just your web server to use instead of using your default credentials since you are a sysadmin on your box.

For a production web application, you should create a dedicated login and user for it use (like your aspnet login), and one give it select/insert/exec permission on the tables, stored procedures, and other entities it needs to access the db. Ideally, it should not be shared between other accounts, or processes.

Does this clarify things?

mark

MarkBenvenuto at 2007-10-2 > top of Msdn Tech,SQL Server,SQL Server Express...

SQL Server

Site Classified