• ry.rith (10/31/2008)


    Thank so much,

    that you tell me about the solution.

    I also do the same of yours to complete the crosstab-report, but something that i want is to know why it's process abnormally.

    any technique, please inform me.

    your faithfully.

    Observe the following line of your code...

    Set @sql=@sql+' WHERE dbo.tab_IC_Packing_List_Detail.PackingListNo='+ char(39)+ @po_no + char(39) + char(13)

    Looks harmless enough until you trace it back to the real problem... which is...

    Alter Proc rsp_IC_PackingList_CrossTab (@po_no [font="Arial Black"]nvarchar[/font](32))

    Ask yourself... what do you get when you concatenate a VARCHAR(8000) with an NVARCHAR of any length? ;)

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)