banner
Workin' on Windows running on Windows Azure
Posts
 
Previous Next 

In order to grant the ASPNET runtime access to your SQL database from the sqlcmd.exe command prompt you need to do the following:

— If permissions exist but are invalid, eg database copied from different machine:

Use mydatabase
Go

drop schema ASPNET
go

sp_droprolemember 'db_owner', ASPNET
go

drop user ASPNET
go

—Now Add back permissions for this machine:

sp_grantlogin 'MACHINENAME\ASPNET'
go

sp_grantdbaccess 'MACHINENAME\ASPNET', 'ASPNET'
go

Sp_addrolemember 'db_owner', 'ASPNET'
go

Alternatively, use the attached batch file which passes in the correct machine name

Comments[1]
  1. 1. Made by James Clarke on 6/15/2010 4:46:14 AM

    And this: sp_grantlogin 'NT AUTHORITY\NETWORK SERVICE'


 Name
  email (will not be shown)
 web site


Close

7/31/2010 11:03:05 AM