Hi,
You got to construct those insert statements into separate variables and use EXEC() function to execute that, as these are dynamic sql statements. Something that looks like this
Code:
Select @strSql = 'INSERT INTO [' + @Target + ']
( [ASAP_Charge_ID]
, [Charge_Description]
, [Update_User_ID]
, [Update_DateTime])
SELECT [Charge_ID]
, [Charge_Description]
, [Update_User_ID]
, [Update_DateTime]
FROM [' + @Source + ']'
Exec(@strSql)
Hope that helps.
Cheers!
_________________________
- Vijay G
Strive for Perfection