SyntaxFix
Write A Post
Hire A Developer
Questions
Or you can use one SQL-command instead of create and call stored procedure
INSERT INTO [order_cart](orId,caId) OUTPUT inserted.* SELECT (SELECT MAX(orId) FROM [order]) as orId, (SELECT MAX(caId) FROM [cart]) as caId;