I know that functions always returns a value and I’ll make a sp which return a value as the function returns and want to calling it inside the function. How might I do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Some thoughts after your comments above
Generally stored procedures can do almost anything. So it is safer to disallow them
The engine can’t reliably work out what your stored procedure does
What about nesting of stored procedures, or recursion, or linked server calls or OPENQUERY calls, and many many other things
What if someone change it later to do some writes?
You can’t schema-bind a UDF to a stored procedure
Error throwing/handling is a state change even if the stored procedure is read only
This is how SQL Server behaves for good reasons