DECLARE sum INTEXEC CalculateSum n = 10 sum = sum OUTPUTSELECT sum
This code declares a variable called @sum, then executes a stored procedure called CalculateSum with a parameter of 10 and an output parameter of @sum. The result of the stored procedure is stored in the @sum variable, and then the value of @sum is selected. However, since the value of @sum is not initialized before calling the stored procedure, this code will result in an error.
原文地址: https://www.cveoy.top/t/topic/gPOy 著作权归作者所有。请勿转载和采集!