Home Forums SQL Server 2008 SQL Server Newbies Storing range of varchar values into variable for future filtering in query RE: Storing range of varchar values into variable for future filtering in query

  • One of many methods ....

    DECLARE @OrderTypes TABLE

    (OrderType CHAR(2))

    INSERT @OrderTypes

    VALUES ('10'),('15'),('18')

    SELECT *

    FROM SalesOrders AS SO

    INNER JOIN @OrderTypes AS OT

    ON SO.OrderType = SO.OrderType

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg