December 5, 2013 at 7:30 am
I copied database from Prod to Dev instance. Whe the database was restored I ran
-----See if there are any orphan users:
EXEC sp_change_users_login 'Report'
The output was :
finq_sql 0xB058747F1E577148862C570381789901
linkserver 0xE040BAD5EEE23049B759C8D750F6C82E
NOTE : These 2 users are SQL users only and I not have password for them. They are there in Prod but not in Dev. SO How do i crate those users in Dev from Prod. I did script the user from Prod but gives me error that 'it does not meet the minimum password requirement'
Can someone please tell me how to create user at instance level and map it to database in Dev?
December 5, 2013 at 7:36 am
In your script that you have to create the logins in dev you need to add the following:
, CHECK_POLICY = OFF
to turn off the password policy. After that try running your sproc again.
December 5, 2013 at 8:16 am
I use the Auto_Fix option on sp_change_users_login to fix orphan users.
Kurt
Kurt W. Zimmerman
SR DBA
Lefrak Organization
New York, NY
http://www.linkedin.com/in/kurtwzimmerman
December 5, 2013 at 8:31 am
Aatish Patel (12/5/2013)
I copied database from Prod to Dev instance. Whe the database was restored I ran-----See if there are any orphan users:
EXEC sp_change_users_login 'Report'
The output was :
finq_sql 0xB058747F1E577148862C570381789901
linkserver 0xE040BAD5EEE23049B759C8D750F6C82E
NOTE : These 2 users are SQL users only and I not have password for them. They are there in Prod but not in Dev. SO How do i crate those users in Dev from Prod. I did script the user from Prod but gives me error that 'it does not meet the minimum password requirement'
Can someone please tell me how to create user at instance level and map it to database in Dev?
This script will generate the create login command retaining the password and SID. execute the script itself against the Prod server and then execute the output against the dev server
SELECT'CREATE LOGIN ' + name + ' WITH PASSWORD = ' +
sys.fn_varbintohexstr(password_hash) +
' HASHED, SID = ' + sys.fn_varbintohexstr(sid) +
', DEFAULT_DATABASE = ' + QUOTENAME(default_database_name) +
', DEFAULT_LANGUAGE = ' + default_language_name +
', CHECK_EXPIRATION = ' +
CASE
WHEN is_expiration_checked = 0 THEN 'OFF'
ELSE 'ON'
END +
', CHECK_POLICY = ' +
CASE
WHEN is_policy_checked = 0 THEN 'OFF'
ELSE 'ON'
END
FROM master.sys.sql_logins
WHERE name = 'yoursqllogin'
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply