Monday, March 12, 2012

logins question

I have a list of user login in xls. How can I add them to SQL 2000 logins
other than manually input one by one? Thanks.Hi,
If u have to give the same authentication to all user thenu can tranfer
all the logins to a sql server table and can create logins.
But it is impossible to make it dynamic if u have to assign diffrent
security policies.
from
Doller|||How can I do it by script automatically? Thanks.
"doller" <sufianarif@.gmail.com> wrote in message
news:1132200368.216850.182800@.g44g2000cwa.googlegroups.com...
> Hi,
> If u have to give the same authentication to all user thenu can tranfer
> all the logins to a sql server table and can create logins.
> But it is impossible to make it dynamic if u have to assign diffrent
> security policies.
> from
> Doller
>|||Hi,
Create a table with the field u need.
then from DTS package transfer all the records from excel to the new
created table.
now create cursor which will bring all the user name one by one and use
it like this
sp_addlogin (@.variable name)
sp_grantdbaccess
sp_grantlogin
HTH
from
Doller|||Mr. Clapton,
If you want to add Windows users and/or groups that would be easy. Use Excel
to create a list of commands like
exec sp_grantlogin [EricClapton]
exec sp_grantlogin [JackBruce]
exec sp_grantlogin [GingerBaker]
...
then copy and paste into Query Analyzer.
If you are adding SQL Server logins it depends if you want to specify also
the password, default database and default language. The most basic example
would be only the login name. Again, use Excel to create a list of commands
like
exec sp_addlogin 'eric'
exec sp_addlogin 'ginger'
exec sp_addlogin 'jack'
...
then copy and paste into Query Analyzer.
Ben Nevarez
" -00Eric Clapton" <a@.b.com> wrote in message
news:OE1O0qy6FHA.1416@.TK2MSFTNGP09.phx.gbl...
>I have a list of user login in xls. How can I add them to SQL 2000 logins
>other than manually input one by one? Thanks.
>

No comments:

Post a Comment