December 16, 2011 at 7:27 am
At this point i havent done anything. I'm assuming i'll have to bring down a file of sort and so on. Can anyone point me in the right direction here?
December 16, 2011 at 7:51 am
It may be possible to do what you're after in a query, but without any sample data or DDL it makes things difficult for us.
Try this for help: http://www.sqlservercentral.com/articles/Best+Practices/61537/
Sounds like something that Excel would eat for breakfast though using a simple VLOOKUP??
December 16, 2011 at 8:10 am
Let me rephase this. Does anyone know where i can get a file that has all the city, state, zips? Preferably a free one? If not does anyone have a suggestion as to where i can get one cheap? Anyone have input as far as pros and cons between the different peolpe who provide sed files? Are some more accurate than others ETC.
Or does sql server allow this now internally? I know the answer is no to this one but whatever. I had to try just in case cause i know they have GEOMETRY and GEOGRAPHY data types in sql server 2008..
December 16, 2011 at 8:29 am
Ahhhh I see...
I assume you're in the US? There's a fantastic one for the UK based on an ordinance survey. That I can link you to if needed?
Try this site perhaps: http://federalgovernmentzipcodes.us/
There are a couple of databases you can try there..
December 16, 2011 at 8:39 am
I needed the same data you did a couple years ago, but we bought something specifically for MS Dynamics Ax.
However, this site has csv files it appears for both the U.S. and Canada - http://www.populardata.com/downloads.html.
December 16, 2011 at 8:39 am
at least for US data, Here's a copy of one of mine; 42K zip codes, mapped to Cty/County/State;
populating city/county/state if you know the zip is no problem, but
if you do it the other way, updating zip code because you know the city, remember that theres more than one zip to a city, so grabbing thats not going to be accurate.
enjoy!
Lowell
December 16, 2011 at 9:42 am
Lowell (12/16/2011)
at least for US data, Here's a copy of one of mine; 42K zip codes, mapped to Cty/County/State;populating city/county/state if you know the zip is no problem, but
if you do it the other way, updating zip code because you know the city, remember that theres more than one zip to a city, so grabbing thats not going to be accurate.
enjoy!
Sweet Lowell. Added that to my collection of random data things. 😀
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
December 16, 2011 at 9:44 am
Excellent guys, thanks!!!!
December 16, 2011 at 10:47 pm
JimbobsQL (12/16/2011)
It may be possible to do what you're after in a query, but without any sample data or DDL it makes things difficult for us.Try this for help: http://www.sqlservercentral.com/articles/Best+Practices/61537/
Sounds like something that Excel would eat for breakfast though using a simple VLOOKUP??
Gosh... why would you have someone do such a thing in Excel? SQL Server will do it just fine and with a whole lot less fanfare.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 17, 2011 at 1:43 am
I had similar requirements for one assignment & luckily my customers bear the pain (to provide the SEED data).
However in our investigation we found something interesting & brought into attention of customer.
‘Zip code Changes over a period of time’. USPS has some algorithm which consider the population distribution per square mile (or some distance unit) and when identify the need it adds / merges zip codes. So any logic you are planning to build around zip codes is at risk.
December 19, 2011 at 11:16 pm
Another thing to remember (in the U.S. at least) is that zip codes can also span city boundaries and even county boundaries. It's not a 1-1 relationship. Zips are not tied to any governmental entity. They are simply distribution areas for the postal service.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
December 19, 2011 at 11:21 pm
The Dixie Flatline (12/19/2011)
Another thing to remember (in the U.S. at least) is that zip codes can also span city boundaries and even county boundaries. It's not a 1-1 relationship. Zips are not tied to any governmental entity. They are simply distribution areas for the postal service.
With all due respect, I tend to disagree here. Postal Services belong to Government (country specific) they can’t cross the country boundaries. The same is applicable to states as well but I am not sure here (may be one incidence, very rare).
December 20, 2011 at 1:49 am
The Dixie Flatline said county boundaries, not country boundaries.
December 20, 2011 at 2:09 am
Cath Trimble (12/20/2011)
The Dixie Flatline said county boundaries, not country boundaries.
Thanks for reminding me to visit Ophthalmologist :doze:
December 20, 2011 at 8:16 am
Whups. What I meant to say was country foundries. They even deliver mail to rural metal casters.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
Viewing 15 posts - 1 through 15 (of 16 total)
You must be logged in to reply to this topic. Login to reply