?
Solved

sql server stored procedure

Posted on 1998-12-16
2
Medium Priority
?
178 Views
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.

Thanks
CM
0
Comment
Question by:milstead
[X]
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
2 Comments
 
LVL 2

Expert Comment

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

Accepted Solution

by:
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
WHERE ...
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

762 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