how to create login to use only select query for Sql server 2005

  • Hi sir,

    Tell me the steps to create login to use only select query for Sql server 2005. I am asking permission to use only select query.

  • SELECT permission is given to USER not to LOGIN . so first you shiuld have LOGIN which will act as USER on any

    database where you want to set this permission

    for login creation

    CREATE LOGIN sam

    WITH PASSWORD = '340$Uuxwp7Mcxo7Khy';

    You can use Create USer to create a user

    USE AdventureWorks;

    CREATE USER sam FOR LOGIN sam;

    and to Grant (Read-only access) you can use the following

    GRANT SELECT TO sam

    Hope that helps.

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply