Solved

OUTPUT table Valued Parameter in SQL server Stored Procedure

Posted on 2011-02-14
2
711 Views
Last Modified: 2012-05-11
HI,
  My client has Requirements that i have to create Stored Procedure  which will return table ,but he need such kind of thing that so returned table can be stored in external table variable.
how i can use Table variable in output parameter then just returning simple result set.
I have to write some Dynamic Query so i can not use Function.
0
Comment
Question by:Theone84
2 Comments
 
LVL 19

Assisted Solution

by:Bhavesh Shah
Bhavesh Shah earned 200 total points
ID: 34886780
Hi,

Its quite not possible to achieve what client says.
check out the link for same
http://odetocode.com/code/365.aspx

What you can use do is, you can use Global Temporary Tables(##).



- Bhavesh
0
 
LVL 50

Accepted Solution

by:
Lowfatspread earned 200 total points
ID: 34886836
table parameters can only be uses as INPUT to a stored procedure...

it is not possible to use on for OUTPUT...

so you are left with  using either True temporary tables (local # or global ##) (or an actual table)

or XML
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question