Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


sql server stored procedure

Posted on 1998-12-16
Medium Priority
Last Modified: 2011-09-20
In a SQL Server Stored Procedure, is it possible to define a recordset and populate it with a select statement? Example would be "Set RS = db.openrecordset("Select * from table1). Then use the recordset and join it with another select * from table2. This would give the final result set for the final report builder.

Question by:milstead
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 1092313
Why not do the join first (all in SQL) and then retrieve it into a single recordset?  

Accepted Solution

Victor Spiridonov earned 20 total points
ID: 1092314
There are no such thing as 'recordset' in T-SQL. but you can create temprary table and then use it:
SELECT a,b,c
INTO #temp_result
FROM table_a
SELECT a,b,c,d
FROM tble_b,#temp_result

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

609 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