Guys,I have to develop report through SSRS.Its advisable to create temp table inside the dataset query?do i need to drop this temp table? what can you say with this approach.any suggestion to facilitate my query.Here is my query. --Create temporary tableCreate table #PurchReceive( Packingslipid nvarchar(30), deliverydate datetime, itemid nvarchar(35), name nvarchar(1000), ordered numeric(28,12), Qty numeric(28,12), remain numeric(28,12), dimension nvarchar(10), purchid nvarchar(30), internalpackingslipid nvarchar(30), inventdimid nvarchar(30), dataareaid nvarchar(4) ) --pull out all records satisfied by issued critera and append to temporary tableInsert into #PurchReceive(Packingslipid,deliverydate,itemid,name,ordered,Qty,remain,dimension,purchid,internalpackingslipid,inventdimid,dataareaid)Select v.PACKINGSLIPID ,v.DELIVERYDATE ,v.ITEMID ,v.NAME ,v.ORDERED ,v.QTY ,v.REMAIN ,v.DIMENSION ,v.PURCHID ,v.INTERNALPACKINGSLIPID ,v.INVENTDIMID ,v.DATAAREAIDFrom VENDPACKINGSLIPTRANS vWhere v.DATAAREAID =(@Dataareaid)and v.DELIVERYDATE >=(@Startdate) and v.DELIVERYDATE <(@Enddate)--Join from other table for data manipulation and relatte other fields.Select p.PACKINGSLIPID ,p.DELIVERYDATE ,p.ITEMID ,p.NAME ,p.ORDERED ,p.QTY ,p.REMAIN ,p.DIMENSION ,p.PURCHID ,p.INTERNALPACKINGSLIPID ,p.INVENTDIMID ,p.DATAAREAIDFrom #PurchReceive pInner Join PURCHLINE lOn l.ITEMID = p.itemid COLLATE Chinese_Taiwan_Stroke_CI_AS and l.PURCHID = p.purchid COLLATE Chinese_Taiwan_Stroke_CI_ASLeft Outer Join PURCHTABLE uOn p.PURCHID = u.PURCHID COLLATE Chinese_Taiwan_Stroke_CI_ASLeft Outer Join INVENTDIM iOn p.INVENTDIMID = i.INVENTDIMID COLLATE Chinese_Taiwan_Stroke_CI_ASand i.DATAAREAID = (@Dataareaid)Left Outer Join INVENTTABLE t On t.ITEMID = p.ITEMID COLLATE nese_Taiwan_Stroke_CI_ASorder by p.purchidDrop table #PurchReceive
Thank you in advance.JOV