• Lowell (8/29/2012)


    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.

    To answer @lowell, I didn't check the original query with EXEC command. I just suggest an alternate solution. Thanks for pointing that out 🙂

    I received and replied to the private message from the creator of this post:

    I replied:

    Actually there is a problem with the apostrophes you have used

    try this:

    Set @project_name_cond=' and (project_name LIKE

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

    I know the above pasted is private message, but wanted to share that maybe this issue is resolved now :unsure:. i think as no reply came.

    BI Developer
    SSRS, SSIS, SSAS, IBM Cognos, IBM Infosphere Cubing services, Crystal reports, IBM DB2, SQL Server, T-SQL
    Please visit... ApplyBI