Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2008

    Unanswered: SQL 2000 DTS. Parse Query Bug?

    I am getting a pain in the butt error in DTS.

    If I use and Execute SQL Task like this ...
    SET @VAR = ?

    EXEC sp_Test @VAR
    and then click parse query I get an error "Syntax error or Access violation"

    However; if I use it this way
    EXEC sp_Test ?
    it works.

    Now here is the odd thing. If I put in a DECLARE statement and a global parameter "?" I get the syntax error.

    But .... If I use a disconnected edit and use DECLARE and "?" then task will run properly. So the problem seems to be with the query parser.

    The problem is I don't have the time to edit everything in a disconnected manner. Is there a way or update that will allow me to use DECLARE and "?". I have tried many hotfixes but none have worked.

  2. #2
    Join Date
    Jan 2007
    Provided Answers: 12
    The problem is not with the parser; it's with your syntax!!
    All variables that are declared must have a datatype; and you can only assign values of that datatype to the variable.

    And ? is not a valid datatype!

    The difference between using a declaration and a variable in a sproc is that in asproc yo are PASSING the value, so when the value reaches the sproc (which is "disconnected" from the DTS), it is implicitly correct.

    Ugh, it's so hard to explain.
    Home | Blog

  3. #3
    Join Date
    Feb 2008

    Found the problem

    I found the problem. It has to do with the DB connection. Different connections validate SQL statements differently. I am going to have to use vbscript instead of Execute SQL Task to get the job done.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts