-- variable table declaration:
declare @TempObjects table (schema_ nvarchar(50), table_ nvarchar(250))
-- set the select statement into the string variable:
declare @SQL as nvarchar(2000)
SET @SQL = 'SELECT..........'
-- insert the string into the table:
insert into @TempObjects(schema_, table_)
EXEC(@SQL)
No comments:
Post a Comment