Solved

SQL Server 2000 script to change ALL users passwords

Posted on 2014-03-11
3
130 Views
Last Modified: 2014-03-14
I'm copying our database to a test environment and I was to make all passwords = 'password' for all the users.  Is there a script that will do this for me?  I can't seem to find it for 2000.

Thanks!
0
Comment
Question by:gebigler
3 Comments
 
LVL 39

Expert Comment

by:lcohan
Comment Utility
I suggest use "Method 1" from article posted below and before you run the script generated from the source SQL server you do a find/replace all and put whatever password you want for all in there:

http://support.microsoft.com/kb/246133
0
 
LVL 69

Accepted Solution

by:
ScottPletcher earned 500 total points
Comment Utility
--code below should do it; naturally you must be a sysadmin to run the code.

DECLARE cursor_logins CURSOR FAST_FORWARD FOR
SELECT name
FROM dbo.syslogins
WHERE
    isntname = 0

DECLARE @name sysname

OPEN cursor_logins

WHILE 1 = 1
BEGIN
    FETCH NEXT FROM cursor_logins INTO @name
    IF @@FETCH_STATUS <> 0
        BREAK
    EXEC sp_password @new = 'password', @loginame = @name
END --WHILE

DEALLOCATE cursor_logins
0
 

Author Closing Comment

by:gebigler
Comment Utility
Thanks for the responses.  Scott, I ran this script and it worked perfectly!  Thanks!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now