SQL Server saves the dataset returned by the stored procedure to a temporary table

Source: Internet
Author: User

Project requirements: In my stored procedures, you need to call the stored procedures written by others in the group and obtain the dataset returned by the Stored Procedure for joint query with my own data.

This stored procedure includes input and output parameters, and contains the insert temporary table operation.

 

I tried several solutions on the Internet, but none of them worked:

1. insert into # tmptable exec pro

Insert statements cannot be nested]

2. insert into # tmptable

Select * From OpenRowSet ('sqlncl', 'driver = {SQL Server}; server = [servername]; uid = [user name]; Pwd = [Password]; database = [database name], 'Clare @ t int exec DBO. pro

''Cy '', @ t output ')

[The object "Exec DBO. Pro 'cy ', @ t output'" cannot be processed '". The ole db access interface "sqlncli" of the linked server "(null)" indicates that this object does not have a column or the current user does not have the permission to access this object .]

 

If any expert has any solutions, please kindly advise. Thank you first !!!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.