Solved

sql server stored procedure

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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now