itsonlyme4
asked on
correct sytax for sp_msforeachdb SQL Server 2005
I am trying to use the sp_msforeachdb stored procedure to execute the following commands and I cannot get the sysntax correct. can anyone help?
When I issue this:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'DOMAIN'.
and when I issue this:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'Auto_fix'.
When I issue this:
sp_msforeachdb 'EXEC dbo.sp_changedbowner @loginame = N'DOMAIN\DomainUser', @map = false'
I get this: Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'DOMAIN'.
and when I issue this:
sp_msforeachdb 'EXEC sp_change_users_login 'Auto_fix', 'DOMAIN\DomainUser''
i get this:Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'Auto_fix'.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER