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 |
Kotti
Posting Yak Master
129 Posts |
Posted - 2009-01-07 : 05:33:18
|
Hi friendsI am new to stored procedurewhen i execute the below query i will get some result .what i need is ,i need to store the result in temporary table EXEC dbo.FindNearestStores '07608'May i know how to do this? |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-01-07 : 05:42:44
|
create table #temp (col1 varchar(...), ...) -- whatever resultset your stored procedure returnsinsert #tempexec dbo.FindNearestStores '07608' E 12°55'05.63"N 56°04'39.26" |
 |
|
Kotti
Posting Yak Master
129 Posts |
Posted - 2009-01-07 : 06:11:58
|
the table should be created at runtime only and not in the database itself |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-01-07 : 06:23:57
|
What is the consumer of the data provided by your stored procedure? E 12°55'05.63"N 56°04'39.26" |
 |
|
Kotti
Posting Yak Master
129 Posts |
Posted - 2009-01-07 : 06:39:09
|
I cant able to understand your question.What i need is ,i need to save the the result in a temporary table. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-01-07 : 06:49:28
|
create table #temp (col1 varchar(...), ...) -- whatever resultset your stored procedure returnsinsert #tempexec dbo.FindNearestStores '07608' E 12°55'05.63"N 56°04'39.26" |
 |
|
Kotti
Posting Yak Master
129 Posts |
Posted - 2009-01-07 : 07:29:47
|
insert #tempexec dbo.FindNearestStores '07608'When i use the above ,the result is inserting in the temporary table.when i use the query by changing the values as belowinsert #tempexec dbo.FindNearestStores '09652'result is inserted into the temporary table,here the result should not be inserted ,it should be overwrited |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-01-07 : 08:02:01
|
insert #tempexec dbo.FindNearestStores '07608'truncate table #tempinsert #tempexec dbo.FindNearestStores '09652' E 12°55'05.63"N 56°04'39.26" |
 |
|
|
|
|