Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server / July 2008

Tip: Looking for answers? Try searching our database.

activate window users in sql 2k

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mecn - 10 Jul 2008 21:14 GMT
Hi,
I am able to activate sql users by exec EXEC sp_change_users_login
'Update_One', 'Mary', 'Mary'

How do I run a scrypt to activate windows user?
thejamie - 10 Jul 2008 22:11 GMT
Generally it is something that occurs when a backup to another machine is
created... and again, generally that backup is there for the developers and
testers to use unless there has been a disaster and you are restoring a
system from scratch.   For me, restoring just for developers and testers
means a limited set of users and I have a job that runs on the agent that can
create all the non-windows authenticated users who will be working on the
test database.   You can script all the users from the database and from the
server (msdb) but in general, the only ones that come across are the ones
that are Windows Authenticated.  The SQL Authenticated users must be
reactivated as you have already noted.

If you give rights to a sql authenticated user, then you will use the EXEC
sp_change_users_login 'Update_One', 'Mary', 'Mary' command you listed but
only if Mary's login is already created on the server.  And you need to do it
for each sql authenticated user on that database.

If the database is copied to a new server, you will also need to recreate
those logins with their specific passwords on that server as well.

To get back to your question, when you restore from backup or when you
detach and reattach the copy, you may be doing it with a script on the SQL
Agent.   If so, add the [EXEC sp_change_users_login 'Update_One', 'Mary',
'Mary'] scripts to the end of the job that performs the restore or reattach
routine to save yourself the trouble of recreating them.  

To script the users, right click the database (and if memory serves me on
SQL 2000) to get a window for creating scripts.  If you select all (a check
box in the upper right I think) you will have the option to script procedures
and the like which you won't need.  On the second tab, you have the ability
to script the users.   That's what you are looking for.

If not, you will probably get flak from Mary and if she is your boss, you
won't forget the next time around.


Signature

Regards,
Jamie

> Hi,
> I am able to activate sql users by exec EXEC sp_change_users_login
> 'Update_One', 'Mary', 'Mary'
>
> How do I run a scrypt to activate windows user?
Mecn - 10 Jul 2008 22:56 GMT
Got it Thanks a lot, I appreciaterd.

> Generally it is something that occurs when a backup to another machine is
> created... and again, generally that backup is there for the developers
[quoted text clipped - 43 lines]
>>
>> How do I run a scrypt to activate windows user?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.