Home » Microsoft SQL Server » 10 - XML Programming in SQL Server 2005
10

Create Web User

How to create a web user identity

  • Go to the management studio. Expand the main security tab, right click 'logins', and click 'New Login...'.
  • In the dialogue, enter '<Your_Windows_loginname>\ASPNET'(exactly this) next to 'Name:'. Click the radio button next to 'Windows' to check it if it is not already checked by default. Select 'booksdb' for default database and click 'OK'.
  • Now, right click on the 'booksdb' database and click 'properties'. Click on the 'permissions' tab in the left panel in the property dialogue.
  • Click on the user name to select the user you just created.
  • In the bottom 'Permissions' panel, scroll to the 'Connect' row and click to check the box under the 'Grant' column if it is not already checked. Similarly, check the 'Execute' box. One neat thing about using stored procedures instead of select statements is that SPs allow you to give a minimal set of permissions to the web user to prevent malicious actions.

You are now ready to browse your application. To run the application, simply open an Internet Explorer Window and browse to the website http://www.edumax.com/assets/files/sql-server/findAuthor.htm and enter a short string like 'ad' or 'sh' or one corresponding to any Author's last name and click the 'Get books' button. You will see the output of the stored procedure for your query.