Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql server run procedure on all databases

DECLARE @command varchar(1000)
SELECT @command = 'IF ''?'' NOT IN(''master'', ''model'', ''msdb'', ''tempdb'') BEGIN USE ? print DB_NAME() END' 
EXEC sp_MSforeachdb @command
 
PREVIOUS NEXT
Tagged: #sql #server #run #procedure #databases
ADD COMMENT
Topic
Name
7+1 =