Calling a stored procedure in a SELECT statement

How do I call a stored procedure in a select statement with input parameters?

link text

Attached is the SELECT statement and the stored procedure.

question.txt (1.6 kB)
more ▼

asked Mar 08, 2016 at 04:27 PM in Default

avatar image

11 2

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

If you say you want to call a stored procedure in a select statement, will the stored procedure return only one value per call(row item returned by the select)? Saying that there won't be 1 to many, but 1 to 1.

If it is a 1 to 1 situation you could look at creating a function that can accept variables and pass back your result that you want and will do it per row returned in your select. Look at Create Function for a base understanding on functions.

more ▼

answered Mar 09, 2016 at 10:47 AM

avatar image

80 2 5

Again in the stored procedure i am calling another executeCmd, which is not supported in the function. Can i resolve this by using Stored proc

Mar 17, 2016 at 09:34 PM diniappani

Calling a stored proc in a stored proc could be an option if I understand what you want to do correctly. Let me know what worked for you.

Mar 18, 2016 at 04:42 AM Button
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Mar 08, 2016 at 04:27 PM

Seen: 63 times

Last Updated: Dec 11, 2016 at 07:28 AM

Copyright 2018 Redgate Software. Privacy Policy