Quick Start Guide to SQL Server 7 -- Part 2
Once you have information in a database, you'll probably want to access it from your application.
But to gain access, you'll first require a username and password login. Then you'll need to grant that login special rights to your tables and so on.
We'll be covering all that in this section.
To create a Login:
- View your Database in Enterprise Manager (as before)
- Click 'Set Up your Database Solution'
- Select 'Create a Login'
- Hit Next at the Welcome screen
- Select the SQL Server authentication mode, then click Next
- If you're running the Desktop edition of SQL Server on Windows 95/98, you will only be able to select SQL Server authentication. This means SQL Server handles all the usernames, passwords and other security issues
- If you're running Windows NT, you will also have the option of using Windows NT authentication. This means you can grant certain NT users direct access to databases, based on their Windows logon, without requiring a separate username and password for SQL Server
- These instructions give advice on creating a login for SQL Server authentication mode
- Enter a login name, then type in the password twice. Click Next when finished
- If you're creating an account for a special user, such as a developer or such like, select the appropriate security roles here. Otherwise, simply ignore. Click Next when finished
- Check the databases you wish to grant this new user access to, then click Next
- Allowing a user access to a database means just that they get access to the database, not the individual objects within it, such as the tables. You need to do this separately (as below)
- Hit Finish to create the login
To grant Table access to a user:
- View your Table Properties (as before)
- Click the 'Permissions' button
- Tick the boxes dependant on which permissions you want to grant the user
- To allow the user to view information in the table, check 'Select'
- To allow new records to be added, check 'Insert'
- To allow the deletion of records, check 'Delete'
- To allow the update of records, check 'Update'
- When granting permissions for stored procedures, which we'll come across later, you'd typically check the 'Exec' (execution) box
- Click OK on the Permissions form, then OK on Table Properties
You will typically assign a username and password combination for either an entire application (ie, one generic login with appropriate permissions), or on an individual user basis.
Page 2 of 5