In this statement, I have to manually change the date of the table name everytime when I want to run this code:
Instead of manually changing it, can I do something like this?
DECLARE @yyyymmdd nvarchar(8)
SET @yyyymmdd = convert(varchar(8),getdate(),112)
INTO TRP.Cap_Data_ & '@yyyymmdd'
I'm not sure if there's a way to do this, but I'm not able to figure out how to. Please help.