Coding Tips & Tricks


Home > SQL

Useful SQL Script to generate Countries & US States

I'm currently working on a project where I need to quickly insert a list of Countries and Us States into a database table. This is not the first time that I've needed to have a useful script handy for this sort of thing. I had a quick look around the net and couldn't find exactly what I needed. So, I've put together two scripts, one to create a table of US States and one to create a table of Countries.

Globe

Download the two scripts:

Countries - here
US States - here

If you've got any useful SQL scripts like this please let me know and I'll add it to this list.








Comments

Steve - 1/24/2011
US State list is missing Alabama.

Fredrik - 6/16/2012
Nice work dude! Thanks alot!

Leonard D - 8/11/2012
THANKS!


Add your comment

300 Characters left


Please fill this in to confirm that you are human