--Step : 1
declare @sql varchar(max);
DECLARE @DateName nvarchar(100)
SET @DateName= 'NXTRPTEmployeeProfile' + CAST( GetDate() as NVARCHAR(12) );
SELECT @DateName = REPLACE(@DateName, ' ', '')
Set @sql = 'SELECT * INTO ' + @DateName +' FROM NXTRPTEmployeeProfile ';
EXECUTE(@sql)
--step 2:
Drop Table NXTRPTEmployeeProfile
--step 3:
SELECT * INTO NXTRPTEmployeeProfile FROM EmpProfile
No comments:
Post a Comment