Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
T-SQL sp_msforeachdb example
EXEC sp_msforeachdb '
if ''?'' LIKE ''CMS[_]%'' begin
print ''?'';
use [?]
select setting as TransactionGateway, ''?'' as [Database]
from dbo.Setting with(nolock)
where Id = ''TransactionGateway''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment