--First Use sp_addlogin to add login exec sp_addlogin ' username ', ' password ', default database
--then grant the user access to a database named exec sp_grantdbaccess ' username '
--finally give the user specific permissions, such as the ability to select a table, depending on the permissions that the user needs to set the use database name grant Select on table name to user name such as to create a new account Appuser, password is pass, and allows the user to have select and update permissions on the test table for the APPDB database, then execute
exec sp_addlogin ' appuser ', ' Pass ', ' appdb ' to use appdb exec sp_grantdbaccess ' appuser ' Go use appdb grant Select,update on Test to Appuser go Grant name grant-give a user, a group or all user access rights syntax GRANT privilege [, ...] On object [, ...] to {public | Group Group | Username} Enter privilege the possible permissions are: All columns/fields of the table/view for the SELECT access declaration. Inserts all column fields into the declared table.
All columns/fields for the table of the update declaration.
Delete Deletes all rows from the declared table.
Rule defines the rules on a table/view (see the CREATE ruleset statement).
All permissions are granted.
object to which the permission is given.
The possible objects are: The table View sequence public representative is shorthand for all users.
Group group to which you want to assign permissions.
Username the name of the user who will be given permission.
Public is shorthand for all users.