| Author |
Topic |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-06-15 : 09:27:39
|
Today I once again wished this Connect Issue was implemented in SQL Serverhttps://connect.microsoft.com/SQLServer/feedback/details/470881It will really help speeding up procedures since you don't have to call them twice in certain cases. The Connect issue is about be able to store two ore more resultset in different tables within same EXEC statement.If you care about the future of SQL Server, please go vote by clicking the Connect link and upvote the issue. N 56°04'39.26"E 12°55'05.63" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-06-15 : 09:51:42
|
Voted up But Instead of havingINSERT INTO Table1 (Col1, Col2), Table2 (ColX, ColY, ColZ)EXEC usp_MyStoredProcedure @Param1, @Param2It is better to identify the resultset and get itEXEC usp_MyStoredProcedure [with RESULTSET n] @Param1, @Param2 Where n is an integer that specifies the resultset numberMadhivananFailing to plan is Planning to fail |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-06-15 : 09:53:12
|
For example this?[with RESULTSET (1, 2, 5, 6) ] N 56°04'39.26"E 12°55'05.63" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-06-15 : 09:56:47
|
quote: Originally posted by Peso For example this?[with RESULTSET (1, 2, 5, 6) ] N 56°04'39.26"E 12°55'05.63"
Yes MadhivananFailing to plan is Planning to fail |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-06-15 : 10:02:27
|
quote: Originally posted by madhivanan Yes 
And how would the syntax be to store the resultset coming from the stored procedure? N 56°04'39.26"E 12°55'05.63" |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-06-15 : 10:04:02
|
Something like this?INSERT Table1 ( Col1, Col2 ), Table2 ( ColX, ColY, ColZ )EXEC dbo.usp_MyStoredProcedure @Param1, @Param2WITH (RESULTSET = {2, 5}) N 56°04'39.26"E 12°55'05.63" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-06-15 : 10:12:29
|
quote: Originally posted by Peso Something like this?INSERT Table1 ( Col1, Col2 ), Table2 ( ColX, ColY, ColZ )EXEC dbo.usp_MyStoredProcedure @Param1, @Param2WITH (RESULTSET = {2, 5}) N 56°04'39.26"E 12°55'05.63"
This is perfect Now I see that a Reporting tool can now very well identify the resultsetMadhivananFailing to plan is Planning to fail |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
|
|
|