MSSql Query solution cum Suggestion Required

Posted by Nirmal on Stack Overflow See other posts from Stack Overflow or by Nirmal
Published on 2010-03-27T11:48:12Z Indexed on 2010/03/27 11:53 UTC
Read the original article Hit count: 230

Filed under:
|
|

Hello All...

I have a following scenario in my MSSql 2005 database.

zipcodes table has following fields and value (just a sample):

zipcode     latitude   longitude
-------     --------   ---------
65201      123.456     456.789
65203      126.546     444.444

and "place" table has following fields and value :

id     name     zip      latitude   longitude
--     ----     ---      --------   ---------
1      abc      65201     NULL        NULL
2      def      65202     NULL        NULL
3      ghi      65203     NULL        NULL
4      jkl      65204     NULL        NULL

Now, my requirement is like I want to compare my zip codes of "place" table and update the available latitude and longitude fields from "zipcode" table.

And there are some of the zipcodes which has no entry in "zipcode" table, so that should remain null.

And the major issue is like I have more then 50,00,000 records in my db. So, query should support this feature.

I have tried some of the solutions but unfortunately not getting proper output.

Any help would be appreciated...

© Stack Overflow or respective owner

Related posts about query

Related posts about sql-server-2005