CodePudding user response:
Circulation after mosaics of the execCodePudding user response:
/*
Precommand with one table structure to create a temporary table
Command1 write check each table query results? Said to satisfy conditions table
Whereand get what you need to collect the table name
Postcommand is query data of temporary tables, and drop the temporary table
*/
The exec sp_MSForEachTable
@ precommand="select Top into 0 * # # TMP from table 1",
@ command1="insert # # TMP select * from?" ,
@ whereand="and o.n ame like '%' table and o.t ype='U'",
@ postcommand="
Select * from # # TMP
Drop table # # TMP "