Hi All,
I am using temp tables in my sql command and it works fine in SSMS , when i copy paste it into the SSIS DFT , the sql is changed. Please see the below codes , the first one is the original which runs fine in SSMS and the second one is in the SSIS. Please help as why and how its getting changed.
declare @SnapshotDate datetime2 = '20180425'; declare @StartDate datetime2; declare @EndDate datetime2; set @StartDate = @SnapshotDate set @EndDate = dateadd(ns, -100, dateadd(day, 1, @SnapshotDate)); IF OBJECT_ID('TEMPDB.dbo.#financial_records') IS NOT NULL DROP TABLE #financial_records select f.Src_id , f.create_date , f.floorplan_id , f.fee_type_id , f.amount_applied , f.responsible_business_id , f.currency_id , f.financial_record_type_id into #financial_records from dbo.revenue f where create_date between @StartDate and @EndDate; select * from #financial_records
DECLARE ? datetime2 = '20180425'; DECLARE ? datetime2; DECLARE ? datetime2; SET ? = ? SET ? = dateadd(ns, - 100, dateadd(day, 1, ?)); IF OBJECT_ID('TEMPDB.dbo.#financial_records') IS NOT NULL DROP TABLE #financial_records SELECT f.Src_id, f.create_date, f.floorplan_id, f.fee_type_id, f.amount_applied, f.responsible_business_id, f.currency_id, f.financial_record_type_id INTO #financial_records FROM dbo.revenue f WHERE create_date BETWEEN ? AND ?; SELECT * FROM #financial_records
error message
Thanks
Lisa