I have this stored procedure with out parameter (code):
SELECT code = RIGHT(CONCAT(REPEAT(0, 6), (SELECT MAX(CONVERT(code, int)) + 1 FROM enterprises)), 6)
If I exec it, return null value, but if I execute the single query, it works right. Why?
I have this stored procedure with out parameter (code):
SELECT code = RIGHT(CONCAT(REPEAT(0, 6), (SELECT MAX(CONVERT(code, int)) + 1 FROM enterprises)), 6)
If I exec it, return null value, but if I execute the single query, it works right. Why?