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 |
mumair
Starting Member
1 Post |
Posted - 2013-01-04 : 02:39:48
|
Hi,I am working on an asp.net application with MS SQL DB. I have the following secnarioA table with User Location InformationUser ID, GEOGRAPHIC POINT, LOCATION TYPEI want to do the following:query above table for a specific user for example userid 1I will get all his locationsnow I want to query the same table again for each of the rows returned above taking the geographic point as parameter so that I can search for any other user within a specific distance.I know how to work with geographic point and get records within a specific distance. However I want your help in how can I loop through the records in first query and combine all resuts in one output.What is the best apporach to this.. for example SQL query, SP, Cursors, or from ASP.net side processing. How can I acheive this? Appreciate all your help in advance. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-01-04 : 02:52:08
|
The best approach to use here would be recursive CTE logicseehttp://msdn.microsoft.com/en-us/library/ms186243(v=sql.105).aspx------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|