Solved

SQL Server 2000 script to change ALL users passwords

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

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

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

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 article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

696 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