The script bellow will create the syntax used to alter the passwords of all users. I use this script when i clone a database from production to development and i don't what that the user maintain the same password. SET NOCOUNT ON SELECT 'ALTER LOGIN [' + loginname + '] WITH CHECK_POLICY=OFF go ALTER LOGIN [' + loginname + '] WITH PASSWORD=''new_passw'' go' FROM syslogins WHERE name NOT IN ('asql') and name not like '%#%' AND isntname = 0
SET NOCOUNT ON SELECT 'ALTER LOGIN [' + loginname + '] WITH CHECK_POLICY=OFF go ALTER LOGIN [' + loginname + '] WITH PASSWORD=''new_passw'' go' FROM syslogins WHERE name NOT IN ('asql') and name not like '%#%' AND isntname = 0