?
Solved

SQL Server 2000 script to change ALL users passwords

Posted on 2014-03-11
3
Medium Priority
?
150 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 40

Expert Comment

by:lcohan
ID: 39921165
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:
Scott Pletcher earned 2000 total points
ID: 39921867
--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
ID: 39930006
Thanks for the responses.  Scott, I ran this script and it worked perfectly!  Thanks!
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

770 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