Export (0) Print
Expand All

Accessing SQL Server as a Local User

Visual Studio .NET 2003

When an ASP.NET application runs, by default it runs in the context of a special local user called ASPNET (in Windows 2000 and Windows XP) or NETWORK SERVICE (in Windows Server 2003). This user account has just enough permissions on the Web server computer to allow the application to run.

If SQL Server and the Web server are on the same computer, you can define the ASPNET or NETWORK SERVICE user as a user on the SQL Server.

The advantages of this method are that it is secure, because the Web application runs within a limited security context. Using a single user name with SQL Server is also efficient because it enables SQL Server to take advantage of connection pooling, enhancing the scalability of the application.

To give the ASPNET or NETWORK SERVICE user SQL Server permissions

  1. From the Windows Start menu, choose Microsoft SQL Server, and then choose Enterprise Manager.
  2. Open the node for the server and expand the node for the database you want to give users permissions for.
  3. Right-click the Users node and choose New Database User.
  4. In the Database User Properties dialog box, enter computername\ASPNET in the Login name box, and then click OK.

See Also

Accessing SQL Server from a Web Application | Database Security | Access Permissions for Web Applications | Security Portal

Show:
© 2014 Microsoft