Did you mean to say sp_msforeachdb?Even then EXEC sp_msforeachdb 'EXEC
sp_grantdbaccess "MyUser", "MyUser"' doesnt work as it is looping within the
database being executed upon.
I guess we may need to loop within all databases in master..sysdatabases and
execute the needed commands.
SQL Server FAQ at
"Aaron Bertrand - MVP" <com> wrote in message