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
sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
chobo2
  • 461
  • 1
  • 10
  • 18

1 Answers1

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

Jason Horner
  • 612
  • 2
  • 6
  • 13
  • Ok thats good it should work but how do I do step 2? – chobo2 Jul 20 '10 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. – Jason Horner Jul 21 '10 at 05:22