Solved

SQL Server 2000 script to change ALL users passwords

Posted on 2014-03-11
3
138 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
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 Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

832 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