Solved

SQL Server 2000 script to change ALL users passwords

Posted on 2014-03-11
3
141 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 500 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

Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

Question has a verified solution.

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

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

749 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