Usage of
sp_executeSQL
SET @sql = 'Select * into ' + @delim_delta_table +
' from ' +
@table_server + '...'
+
@delim_table_name + '
where ' + @timestamp_col_name + ' > @LastTimeIN' + ' and '
+
@timestamp_col_name + '
<= @TimeMax '
select
@parmlist = '@LastTimeIN
datetime, @TimeMax datetime'
exec sp_executesql @sql, @parmlist, @LastTimeIN=@last_time
, @TimeMax=@time_max
No comments:
Post a Comment