ParamByName with temporary table
Posted: Wed 03 Nov 2010 18:48
When I try to perform,
SELECT * into #Temp_Test FROM dbo.Employee
WHERE Id = 00001 AND ((MONTH(LastDate) <= :pMonth and YEAR(LastDate) = :pYear) or YEAR(pLastDate) < :pYear)
It's drop the temporary table and I can't access it later.
But if I hard code the params on the query, it works fine.
Could you help me?
SELECT * into #Temp_Test FROM dbo.Employee
WHERE Id = 00001 AND ((MONTH(LastDate) <= :pMonth and YEAR(LastDate) = :pYear) or YEAR(pLastDate) < :pYear)
It's drop the temporary table and I can't access it later.
But if I hard code the params on the query, it works fine.
Could you help me?