0

I have an IIS 7 server(2008 ) and ms sql server 2005 on the same machine. I want my application pool that was created to be able to access ms sql server 2005.

How can I do this

  1. Set your app pool to a account (I think it is done - in the application pool I have created a new pool).
  2. Give that account, access to you SQL Server & database

1 Answer 1

0

Yes this should work, depending on your requirements, you could use the "NetworkService" account; but this may not be best practice in your environment.

Here is the TSQL to implement (Replace AdventureWorks with your Database name)

USE [AdventureWorks]
GO
CREATE USER [NT AUTHORITY\NETWORK SERVICE] FOR LOGIN [NT AUTHORITY\NETWORK SERVICE]
GO
USE [AdventureWorks]
GO
EXEC sp_addrolemember N'db_datawriter', N'NT AUTHORITY\NETWORK SERVICE'
GO
USE [AdventureWorks]
GO
EXEC sp_addrolemember N'db_datareader', N'NT AUTHORITY\NETWORK SERVICE'
GO

Note this will give the account read and write permission; but no permission to execute sprocs , I would recommend creating a Database role and granting the execute right to all sprocs then assigning the database user to the role.

More info: http://vyaskn.tripod.com/sql_server_security_best_practices.htm

2
  • Ok thats good it should work but how do I do step 2?
    – chobo2
    Jul 20, 2010 at 23:47
  • fixed post to address your comment. Itis imperative that you understand the basics of Sql Server Security before picking an approach that best meets your requirements. Jul 21, 2010 at 5:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .