Solved

sql server stored procedure

Posted on 1998-12-16
2
177 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 10 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

729 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