Wednesday, March 24, 2010

SQL Server Network Service for ASP.NET User

if not exists (select * from master.dbo.syslogins where loginname = N'NT AUTHORITY\NETWORK SERVICE')
exec sp_grantlogin N'NT AUTHORITY\NETWORK SERVICE'
GO
exec sp_grantdbaccess N'NT AUTHORITY\NETWORK SERVICE', N'NT Authority\Network Service'
GO
exec sp_addrolemember N'db_owner', N'NT Authority\Network Service'
GO

No comments:

Post a Comment