• Are you sure about that?

    copy and paste it to SSMS...that stops right away with a syntax check, since the EXEC command cannot exist inside the parameter list.

    H4K (8/29/2012)


    You don't have to use a SP. you can just replace following code:

    SELECT value from dbo.Fn_tsp_orderhistory(EXEC STORED_PROC_NAME

    ('''+@c+''')

    WITH

    SELECT value from dbo.Fn_tsp_orderhistory( '%' + REPLACE( @C, '*', '%') + '%')

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!