Hello @Mahima Lalwani ,
Thanks for the ask and using the Microsoft Q&A platform .
I think the intend is by using ADF but before you run the select query for lookup you want to get some other things done and one of them is to truncate a table also .
-- Data prep
CREATE TABLE to_be_trucated
( id int )
INSERT INTO to_be_trucated VALUES(1)
-- You are trying this
Truncate table to_be_trucated
GO
with CTE AS
(
select colB,ColC from [dbo].[someothertable] )
Select * from CTE
You can use the lookup activity and use the query option and add the below script
Truncate table to_be_trucated ;
with CTE AS
(
select colB,ColC from [dbo].[someothertable] )
Select * from CTE
Thanks
Himanshu
Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members