Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Shaft
Starting Member
5 Posts |
Posted - 2006-12-12 : 10:24:36
|
Hi All,I've created 4 stored procedures that all have employeeID in common and I want to combine the results, using one stored procedure so that I can display the results in a vb.net datagrid. I've tried combining the results in a dataset in .net but have failed to get them to display alltogether in a datgrid, I can only get individual stored procedures results to show.Thank u in advance |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-12-12 : 10:37:55
|
either put your 4 result sets into one resultset in the stored procedure with putting the results into a pre-createdtemp table withinsert into #temp1exec sproc1and then "union all"-ing all of the temp tablesoruse DataTable.ImportRow method to import rows into the resultset you want on the client.Go with the flow & have fun! Else fight the flow blog thingie: http://weblogs.sqlteam.com/mladenp |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-12-12 : 11:17:12
|
orHave other procedure where you copy the result to temp tableinsert into #temp1exec sproc1insert into #temp1exec sproc2etcMadhivananFailing to plan is Planning to fail |
 |
|
Shaft
Starting Member
5 Posts |
Posted - 2006-12-12 : 11:39:05
|
Thanks for the reply but I don't think I've explained myself very well the information from each table is different but relates by employeeID eg (SPROC 1:EmployeeID, FirstName, Surname SPROC 2:EmployeeID, AuditScore) and I want to combine them into (SPROC:EmployeeID, FirstName, Surname, AuditScore)so I don't think your method will work but I'm new to stored procedures so not sure. |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-12-12 : 11:49:32
|
I think you need to use Joinor post some sample data with expected resultMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|