Created
January 4, 2017 02:03
-
-
Save drmohundro/c0569f464e99bc16b0219e3e5b7206b7 to your computer and use it in GitHub Desktop.
T-SQL sp_msforeachdb example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EXEC sp_msforeachdb ' | |
if ''?'' LIKE ''CMS[_]%'' begin | |
print ''?''; | |
use [?] | |
select setting as TransactionGateway, ''?'' as [Database] | |
from dbo.Setting with(nolock) | |
where Id = ''TransactionGateway'' | |
END | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment