Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Fullresult set as Variable in SSIS

Author  Topic 

Reginajosephine
Starting Member

4 Posts

Posted - 2010-03-18 : 15:18:12
I am pulling data from a DB2 database using a parameter for the Fiscal Year and I would like to use a list of values from a table on my SQL Server to pull certain skus. I created an Execute SQL Task to pull the skus I need from the database and this is the SQL Statement I'm using: SELECT SkuNumber FROM BT_tblCompleteSkuList. This query returns 177 rows and that is what I want to use in my where clause. When I change the Execute SQL Task to FullResultSet the job fails.

This is my current query with the hardcoded values.

WHERE PRDMDM.D_USRTL_PDT_V.PDT_KY = PRDMDM.F_USRTL_WK_SLS_V.PDT_KY AND
PRDMDM.F_USRTL_WK_SLS_V.SALES_LOC_KY = PRDMDM.D_USRTL_SLS_LCN_V.LOC_KY AND
PRDMDM.F_USRTL_WK_SLS_V.BSN_EFF_FSC_WK_KY = PRDMDM.D_TIME_FSC_WK_V.FISCAL_WEEK_KY AND
(PRDMDM.D_TIME_FSC_WK_V.FISCAL_YEAR = ?) AND (PRDMDM.D_USRTL_PDT_V.SKU_NUMBER IN (795996,795997,767828,767833,767838,767841,767844,767847,788211,788212,795998,788165,767701,767703,
767707,788162,788195,788199,788201,788207,788221,767278,788219,767279,796004,796013,767829,767831,
796015,798914,796017,767835,767329,767837,796014,796018,767337,767857,767858,767859,788213,767839,
767840,767846,767856,767852,788214,767982,767983,767986,798891,767987,767989,767990,767991,767992,
767993,767998,767280,767281,767708,767999,798895,767283,767850,767851,795999,798917,796000,767853,
767709,767719,796004,796013,767829,767831,767726,767860,796014,788222,796008,796009,796010,796011,
796012,796020,796024,795995,818483,818491,818495,818488,818498,818489,818496,818497,818487,818502,
818503,818508,818512,818504,818505,818507,818514,818516,767864,767865,818517,818520,767866,768005,
796019,796021,796022,796023,767427,768536,768541,768548,767872,788215,768543,768550,796001,796002,
768552,768556,768560,768568,768569,767874,796003,768558,768565,788209,788210,796005,796006,798919,
796007,798920,767999,768005,798895,770294,783482,783483,783484,783485,783486,783507,783508,783509,
783510,783511,783512,783513,783515,800456,801986,800451,800453,800265,802142,800448,806495,806195,
807068,805697,805696,800456,823949,813761,824357,813762,824357,823949,841428,841431,845048,848567,
849248,823947,858162,860049,860960,860963))

I want to eliminate the sku numbers and use the result of the Execute SQL Task instead. The variable for Fiscal Year works fine because the result is a single row.

Can anyone help me. I've spent a lot of time researching and I cannot get it to work. I have declared my variable as an Object because I read that full resultsets must be objects.



Regina Beauregard
   

- Advertisement -