Sunday, March 25, 2012

Creating user

Hi,
I've just installed MSDE, and I'm wondering how to create user so I
don't have to login as 'sa' user.
Thanks in advance
ukasz
Try:
sp_addlogin '<userName','<password>'
Look for sp_addlogin / sp_grantlogin in the BOL.
HTH, Jens Suessmeyer.
|||Hi,
To add on Jens:-
MSDE will not come with GUI tools; so you need to login using OSQL to sql
server and issue TSQL commands to create Logins and users.
For eg; if you need to create a user HARI with read only rights in Finance
database then:-
From command line:-
OSQL -S <servername> -Usa -P<sapassword> (enter)
SP_addlogin 'hari','haripass'
go <enter>
Use Finance
go <enter>
sp_adduser 'hari'
go <enter>
sp_addrolemember 'db_datareader','hari'
go <enter>
he above commands will create user Hari with read rights in Finance
database.
Thanks
Hari
SQL Server MVP
"Jens" <Jens@.sqlserver2005.de> wrote in message
news:1126692828.991504.289480@.g47g2000cwa.googlegr oups.com...
> Try:
> sp_addlogin '<userName','<password>'
> Look for sp_addlogin / sp_grantlogin in the BOL.
> HTH, Jens Suessmeyer.
>
|||Hari Prasad wrote:
> Hi,
> To add on Jens:-
> MSDE will not come with GUI tools; so you need to login using OSQL to sql
> server and issue TSQL commands to create Logins and users.
> For eg; if you need to create a user HARI with read only rights in Finance
> database then:-
> From command line:-
> OSQL -S <servername> -Usa -P<sapassword> (enter)
> SP_addlogin 'hari','haripass'
> go <enter>
> Use Finance
> go <enter>
> sp_adduser 'hari'
> go <enter>
> sp_addrolemember 'db_datareader','hari'
> go <enter>
> he above commands will create user Hari with read rights in Finance
> database.
> Thanks
> Hari
> SQL Server MVP
>
>
> "Jens" <Jens@.sqlserver2005.de> wrote in message
> news:1126692828.991504.289480@.g47g2000cwa.googlegr oups.com...
>
>
Thanks.
|||Hari Prasad wrote:
> Hi,
> To add on Jens:-
> MSDE will not come with GUI tools; so you need to login using OSQL to sql
> server and issue TSQL commands to create Logins and users.
> For eg; if you need to create a user HARI with read only rights in Finance
> database then:-
> From command line:-
> OSQL -S <servername> -Usa -P<sapassword> (enter)
> SP_addlogin 'hari','haripass'
> go <enter>
> Use Finance
> go <enter>
> sp_adduser 'hari'
> go <enter>
> sp_addrolemember 'db_datareader','hari'
> go <enter>
> he above commands will create user Hari with read rights in Finance
> database.
> Thanks
> Hari
> SQL Server MVP
>
>
> "Jens" <Jens@.sqlserver2005.de> wrote in message
> news:1126692828.991504.289480@.g47g2000cwa.googlegr oups.com...
>
>
Thanks
ukasz

No comments:

Post a Comment