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 |
|
elangovan
Starting Member
6 Posts |
Posted - 2006-09-15 : 03:30:21
|
| I have written Two SP in sql Server 2000. i am calling the Second Sp inside of First one. I need to send the query output to another Sp from First one. Please Note the Code flow.Create Proc AASBEGINEXEC AA(SELECT * FROM TableName FOR XML AUTO)END Create Proc AA @AA As nTextASBEGINselect .......OPENXML().....END I can not do this. is it Possible or tell Some solution to implement this kind of things.RegardsElango.V |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-09-15 : 03:35:02
|
[code]Create Proc AASBEGIN CREATE TABLE #TEMP ( . . . ) -- Temp table structure should be same as output of AA INSERT INTO #TEMP EXEC AA 'SELECT * FROM TableName FOR XML AUTO'ENDCreate Proc AA@AA As nTextASBEGINselect.......OPENXML().....END [/code] KH |
 |
|
|
mahesh_bote
Constraint Violating Yak Guru
298 Posts |
Posted - 2006-09-15 : 03:36:13
|
quote: Originally posted by elangovan I have written Two SP in sql Server 2000. i am calling the Second Sp inside of First one. I need to send the query output to another Sp from First one. Please Note the Code flow.Create Proc AASBEGINEXEC AA(SELECT * <specific field> FROM TableName FOR XML AUTO)END Create Proc AA @AA As nTextASBEGINselect .......OPENXML().....END I can not do this. is it Possible or tell Some solution to implement this kind of things.RegardsElango.V
Hopes it will work, let us know, if any prob.Mahesh |
 |
|
|
elangovan
Starting Member
6 Posts |
Posted - 2006-09-15 : 03:37:47
|
| i need to Send query output(without Temp Table) to another SP. |
 |
|
|
mahesh_bote
Constraint Violating Yak Guru
298 Posts |
Posted - 2006-09-15 : 03:38:46
|
quote: Originally posted by mahesh_bote
quote: Originally posted by elangovan I have written Two SP in sql Server 2000. i am calling the Second Sp inside of First one. I need to send the query output to another Sp from First one. Please Note the Code flow.Create Proc AASBEGINEXEC AA(SELECT * <specific field> FROM TableName FOR XML AUTO)END Create Proc AA @AA As nTextASBEGINselect .......OPENXML().....END I can not do this. is it Possible or tell Some solution to implement this kind of things.RegardsElango.V
Hopes it will work, let us know, if any prob.Mahesh
KHTAN can't we specify specified field name as i have suggested earlier?Mahesh |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-09-15 : 03:44:22
|
quote: Originally posted by elangovan i need to Send query output(without Temp Table) to another SP.
You need to send query output from sp AA to sp A ?What's the consideration of not using temp table ? KH |
 |
|
|
elangovan
Starting Member
6 Posts |
Posted - 2006-09-15 : 03:51:25
|
| Yes. i have written two SPs in Differen DB. it may be Same server or Different Server.first Sp in Database1 and Second one in Database2. |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-09-15 : 05:05:04
|
quote: Originally posted by elangovan Yes. i have written two SPs in Differen DB. it may be Same server or Different Server.first Sp in Database1 and Second one in Database2.
If both SPs are on different servers, first thing is to add second server as linked server to first one and change SP to following:Create Proc AASBEGINSelect * into #temp from openquery(server2, 'exec db2..ProcA(''SELECT * FROM TableName FOR XML AUTO'')')Select * from #tempEndHarsh AthalyeIndia."Nothing is Impossible" |
 |
|
|
|
|
|