Link to home
Start Free TrialLog in
Avatar of Brenda Hernandez
Brenda Hernandez

asked on

Autofix using msforeachdb

Hi All,
Trying to get a stored procedure to change a login after restoring several databases.
This is what I have
exec master..sp_msforeachdb " EXEC ?..sp_change_users_login 'Auto_Fix', 'PassLogin"'
I get an error on COUNT.  Can anyone give me a hand?
Avatar of Brenda Hernandez
Brenda Hernandez

ASKER

No bites?  Some guru out there surely knows the answer to this!
ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
BINGO!
I tried every combination of quotes I could think of, but couldn't get it right.
Script works like a charm!