Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Orphan login issue


SQL Orphan login issue

Author
Message
Aatish Patel
Aatish Patel
SSC Rookie
SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)

Group: General Forum Members
Points: 35 Visits: 265
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?
Keith Tate
Keith Tate
SSChasing Mays
SSChasing Mays (614 reputation)SSChasing Mays (614 reputation)SSChasing Mays (614 reputation)SSChasing Mays (614 reputation)SSChasing Mays (614 reputation)SSChasing Mays (614 reputation)SSChasing Mays (614 reputation)SSChasing Mays (614 reputation)

Group: General Forum Members
Points: 614 Visits: 979
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.



Microsoft Certified Master - SQL Server 2008
Follow me on twitter: @keith_tate

Forum Etiquette: How to post data/code on a forum to get the best help
Richard Fryar
Richard Fryar
SSC Veteran
SSC Veteran (289 reputation)SSC Veteran (289 reputation)SSC Veteran (289 reputation)SSC Veteran (289 reputation)SSC Veteran (289 reputation)SSC Veteran (289 reputation)SSC Veteran (289 reputation)SSC Veteran (289 reputation)

Group: General Forum Members
Points: 289 Visits: 1171
http://www.sqlservercentral.com/scripts/Logins/104750/

If you are comfortable with PowerShell, this will script the login with the same password and SID.


Check Your SQL Servers Quickly and Easily
www.sqlcopilot.com
Kurt W. Zimmerman
Kurt W. Zimmerman
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1062 Visits: 1396
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
Perry Whittle
Perry Whittle
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

Group: General Forum Members
Points: 8780 Visits: 16554
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" ;-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search