aimlion11yahoo
Instructor
I have a PROC name MAIN.
MAIN calls 2 other PROCs: SUB1 and SUB2
When SUB1 is called, it does a INSERT INTO on the table ORDERS.
A automatic number is generated for the OrderID field
When SUB2 is called, it does a INSERT INTO on the table ORDER_DETAILS and the insert must contain the OrderID generated in SUB1.
I am using SQL Query Analyzer to test this out, but I cannot return the @OrderID in order to pass it to SUB2 unless I remove BEGIN and END from SUB1.
Is there a rule that you can return OUTPUT values if you have a BEGIN and END in your procedure?
MAIN calls 2 other PROCs: SUB1 and SUB2
When SUB1 is called, it does a INSERT INTO on the table ORDERS.
A automatic number is generated for the OrderID field
When SUB2 is called, it does a INSERT INTO on the table ORDER_DETAILS and the insert must contain the OrderID generated in SUB1.
I am using SQL Query Analyzer to test this out, but I cannot return the @OrderID in order to pass it to SUB2 unless I remove BEGIN and END from SUB1.
Is there a rule that you can return OUTPUT values if you have a BEGIN and END in your procedure?