Home Forums SQL Server 7,2000 T-SQL Stored Procedure that uses a parameter in a WHERE x IN(@param1) RE: Stored Procedure that uses a parameter in a WHERE x IN(@param1)

  • Budd (11/21/2016)


    Eirikur Eiriksson (11/20/2016)


    Budd (11/18/2016)


    WOW!!!

    So very many possibilities, and so much to consider..

    Quick questions, can you use Table Variable Parameter? How wide are the largest values passed? How many values at the most would be passed? Have you thought of using dynamic SQL?

    😎

    Quick Answers;

    Probably, had not attempted that.

    12 at most.

    Dynamic SQL is always my last resort.

    How wide are the largest values passed? Are all the values of similar length?

    😎

    Dynamic SQL could be the best option if done correctly, obviously depending on the type of values passed and how the values are used in the procedure. Have seen huge performance improvements when changing from splitting functions to dynamic SQL but as I said, it depends.

    Further, fixed length parameters are easier and much faster to split than variable length parameters, almost by the factor of the length of the parameters.