DTS package with parameter in Like statement

  • Hi,

    I've a problem with a DTS package. It gives not always the correct result.

    The SQL statement is:

    Select * from MyTable

    where MyFLD1 = 'AA' and

    MyFLD2 like ? and

    MyFLD3 like ?

    I defined a Global variable for both the ? signs.

    When I put a % in G_Var1 and a % in G_Var2 The result is No records found.

    When I put 'P58EXTIME%' in G_Var1 an '%' in G_Var2 The result is 500 records found.

    When I put 'P58EXTIM%' in G_Var1 an '%' in G_Var2 The result is NO records found.

    I'm using SQL2000

    The Global variables are defined as String datatype.

    Who can help me????

    mvg,

    Johan

  • Which of the results do you expect should return?

    Please provide sample data and table definitions for the best chance at getting an accurate answer to your question.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • If you are really on SQL Server 2008, then you should seriously consider using SSIS instead of DTS, its much better overall, and much better supported under 2008.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply