SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Hw to execute stored procedure using select statement?


Hw to execute stored procedure using select statement?

Author
Message
nareshmsbi13
nareshmsbi13
Valued Member
Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)

Group: General Forum Members
Points: 70 Visits: 76
I have execute my stored procedure using a select statement like
Exec SP where select * from view,wt is the finall out put of this query can some one tell me the answer,,
And one more thing is have to manipulate the Temprory tables,Is it manipulate the temprory tables ,but how some one tell me the answer with an example
Neeraj Dwivedi
Neeraj Dwivedi
SSCrazy
SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)

Group: General Forum Members
Points: 2045 Visits: 1341
I think you should use Table Valued Parameter. The below link has examples in it too.

http://blog.sqlauthority.com/2008/08/31/sql-server-table-valued-parameters-in-sql-server-2008/
Lowell
Lowell
SSC Guru
SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)

Group: General Forum Members
Points: 72530 Visits: 40945
nareshmsbi13 (5/8/2013)
I have execute my stored procedure using a select statement like
Exec SP where select * from view,wt is the finall out put of this query can some one tell me the answer,,
And one more thing is have to manipulate the Temprory tables,Is it manipulate the temprory tables ,but how some one tell me the answer with an example


you will need to create a temporary table to capture the stored proc results: you have to know the datatypes to build your table beforehand:

CREATE TABLE #tmp(
view varchar(30),
wt varchar(30) )

--insert the results into the properly shaped temp table
INSERT INTO #tmp
EXEC pr_MyProcedure @Param = 42

SELECT * FROM #tmp



Lowell
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search