dbTalk Databases Forums  

Error while using parameterized batch code as Sql Command in SSIS

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Error while using parameterized batch code as Sql Command in SSIS in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sumanta Gayen
 
Posts: n/a

Default Error while using parameterized batch code as Sql Command in SSIS - 05-24-2006 , 07:26 AM






I am using an LOEDB source in my Data Flow. My Sql Command is a complex sql
batch logic instead of a single sql query, which looks like this:
"
SET NOCOUNT ON

Declare @Table1 Table(GroupId Varchar(10) NOT NULL,
GroupName Varchar(50) NOT NULL, TAT Int)

INSERT INTO @Table1 (GroupId, GroupName, TAT)
SELECT G.RowId, Convert(Varchar(50),G.Name),
Avg(DateDiff(mi,SR.Created,SR.CloseDate))
FROM dbo.MSGroup G
LEFT JOIN ServiceRequest SR
ON G.RowID = SR.GroupID
And SR.Priority = '1 - Immediate'
WHERE G.Name IN (?)
GROUP BY G.RowId, G.Name
"

Though this code works whithout using a parameter, it gives following error
when using a parameter: "Parameters cannot be extracted from the SQL command.
The provider might not help to parse parameter information from the command.
In that case, use the "SQL command from variable" access mode"

Its really hard yo use a Variable to store the entire complex sql command.
This funtionality was perseent in DTS 2000, but it doesn't seems to be
working in SSIS. Is there any other alternative to make it work.

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Error while using parameterized batch code as Sql Command in SSIS - 05-25-2006 , 03:31 AM






Hello Sumanta,

Please see my reply to your other version of this question. please only
post the same question with one subject. It stops one person answering on
one thread and another on the other and they are effectively answering the
same post


Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

Quote:
I am using an LOEDB source in my Data Flow. My Sql Command is a
complex sql
batch logic instead of a single sql query, which looks like this:
"
SET NOCOUNT ON
Declare @Table1 Table(GroupId Varchar(10) NOT NULL,
GroupName Varchar(50) NOT NULL, TAT Int)
INSERT INTO @Table1 (GroupId, GroupName, TAT)
SELECT G.RowId, Convert(Varchar(50),G.Name),
Avg(DateDiff(mi,SR.Created,SR.CloseDate))
FROM dbo.MSGroup G
LEFT JOIN ServiceRequest SR
ON G.RowID = SR.GroupID
And SR.Priority = '1 - Immediate'
WHERE G.Name IN (?)
GROUP BY G.RowId, G.Name
"
Though this code works whithout using a parameter, it gives following
error when using a parameter: "Parameters cannot be extracted from the
SQL command. The provider might not help to parse parameter
information from the command. In that case, use the "SQL command from
variable" access mode"

Its really hard yo use a Variable to store the entire complex sql
command. This funtionality was perseent in DTS 2000, but it doesn't
seems to be working in SSIS. Is there any other alternative to make it
work.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.