Monday, March 19, 2012

DTS package problems

I am working on a DTSPackage and have had nothing but bad luck.

1) the query is below. I want to sub out @.GUID with a GlobalGUID variable I set using

dynamic property. All I get when I try to set

GUID = ?

instead of GUID = @.GUID

when I hit the Parameters button all I get is this error

MicrosoftOLE DBProvider for SQL Server

Error Description:Syntax error or access violation

What can be wrong here? If I go the package properties I can

see the GlobalVariable I created.

Thanks for any leads.

Bob

>>>>>>>>>>>>>>>>>>>>>>>>>>

DECLARE @.CurrentPeriod CHAR(4)
DECLARE @.GUID VARCHAR(50)


exec usp_Get_Period_UserPeriod @.CurrentPeriod OUTPUT


SELECT ProductCode AS [Code], ProductName AS [Short], ProductDescription AS [Long],
case CHARINDEX(',',SORT,1) when 1 then space(10) else LEFT(SORT,CHARINDEX(',',SORT,1)-1) end+SPACE(10) AS [Sort],
case when CHARINDEX(',,',SORT)>0 then space(10) else
SUBSTRING(SORT,CHARINDEX(',',SORT,1)+1,
CHARINDEX(',',SORT,CHARINDEX(',',SORT,1)+1)-CHARINDEX(',',SORT,1)-1) end +SPACE(10) AS [SortALN],
case RIGHT(SORT,1) when ',' then space(10) else
REVERSE(case CHARINDEX(',',REVERSE(SORT),1) when 1 then space(2) else LEFT(REVERSE(SORT),CHARINDEX(',',REVERSE(SORT),1)-1) end) end +SPACE(10) AS [SortALI]
FROM PRODUCTMASTER WHERE ProductCode IN
(SELECT PRODUCTCODE FROM DRPRODUCT WHERE GUID = @.GUID) AND PERIOD = @.CurrentPeriod ORDER BY SORT

Try the link below for a work around. Hope this helps.

http://www.sqldts.com/default.aspx?234

No comments:

Post a Comment