sql server 2000 - TEXT datatype input parameter to a SP

  • Hello All,

    I have a proc test_put_inbound, that accepts @payload as a TEXT. I have another table TEMP_PAYLOAD that has column xml_payload with type TEXT.

    I need to call procedure test_put_outbound and pass to it the value from TEMP_PAYLOAD.xml_payload. Since we can't create TEXT as local variable in SQL2000, I cannot 'hold' the value from TEMP_PAYLOAD.xml_payload in a variable.

    Is there a way for me to do something like:

    EXEC test_put_outbound <dynamically execute>'SELECT xml_payload FROM test_put_outbound'.

    I have tried sp_executesql but to no avail.

    Any help will be much apreciated on how to execute such procedure. I can't modify test_put_outbound, it's some standard for the company. I have to use sql server 2000 for this project and it's like going back to stone age! 🙁

    CREATE PROCEDURE test_put_outbound (

    @payload_in TEXT)

    AS

    BEGIN

    INSERT INTO TEMP_OUTBOUND_TEST (application_payload)

    values(@payload_in)

    END

    CREATE TABLE [dbo].[temp_payload](

    [xml_payload] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL

    )

    INSERT INTO TEMP_PAYLOAD ('<ORDER_DETAIL><BAR_CODE>BARCODE1</BAR_CODE><QUANTITY>10</QUANTITY></ORDER_DETAIL><ORDER_DETAIL><BAR_CODE>BARCODE2</BAR_CODE><QUANTITY>20</QUANTITY></ORDER_DETAIL><ORDER_DETAIL><BAR_CODE>BARCODE3</BAR_CODE><QUANTITY>30</QUANTITY></ORDER_DETAIL>')

    CREATE TABLE temp_outbound_test (application_payload text)

    Regards,

    AT

  • Does anybody have any suggestions for my question above?

  • This is a forum not a chatroom. Everyone here is a volunteer, answering questions in their free time. Have some patience.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply