Re: Error while using parameterized batch code as Sql Command in SSIS

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

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.



.



Relevant Pages

  • RE: SBS2003 Standard - managing the SQL installation?
    ... information for how to use SQL command line for MSDE 2000: ... 325003 How To Manage the SQL Server Desktop Engine (MSDE 2000) by Using the ... This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)
  • Re: Issue in SSIS, OLEDB source command
    ... batch logic instead of a single sql query, ... GroupName VarcharNOT NULL, TAT Int) ... use the "SQL command from ...
    (microsoft.public.sqlserver.dts)
  • Re: Trapping error for $dbh->do()
    ... Pasting values into the SQL command requires careful quoting. ... Failing to quote correctly allows SQL injection, a common exploit for www tools, but this is also possible with command line and GUI tools. ... With parameters, the DBD::whatever takes care of quoting as a last resort, but usually, parameter values and command are transported separately to the database. ...
    (perl.dbi.users)
  • Re: SQL Message
    ... its explanation is geared to people who know what SQL is and why ... Microsoft and can only surmise why their software displays this message, ... "Opening this document will run the following SQL command: ...
    (microsoft.public.word.mailmerge.fields)
  • Im having trouble with SQL
    ... SELECT statement to the SQL command, ... Even after inserting the data, some of it might go missing. ... but since my current Delphi 5 doesn't ...
    (comp.lang.pascal.delphi.misc)