SQL Pass Pass Имя таблицы в качестве переменной
declare @schema varchar(50)
declare @table varchar(50)
declare @query nvarchar(500)
set @schema = 'dbo'
set @table = 'ACTY'
set @query = 'SELECT * FROM [DB_ONE].[' + @schema + '].[' + @table + '] EXCEPT SELECT * FROM [DB_TWO].[' + @schema + '].[' + @table + ']'
EXEC sp_executesql @query
Shy Seal