Home » SQL Tips

SQL Tips – List of Countries (2018 revision)

Over nine years ago, I published a SQL and tab delimited list of countries sourced from Wikipedia and ISO. After numerous comments about it being out of date, here is an updated version….. The data was sourced from…

Read More »

SQL Tips – Identifying which version of SQL Server you are using

If you need to find out the version of SQL Server you are using, simply use the following script: SELECT SERVERPROPERTY(’productversion’), SERVERPROPERTY(’productlevel’), SERVERPROPERTY(’edition’)SELECT SERVERPROPERTY(‘productversion’), SERVERPROPERTY(‘productlevel’), SERVERPROPERTY(‘edition’)

Read More »

SQL Tips – List of Top Level Domains

Here is SQL and a text list of the Top Level Domains currently in use on the internet The list is free for all to use for any purpose. The original data was sourced from IANA on Thursday…

Read More »

SQL Tips – List of New Zealand Towns and Cities

Here is SQL and a text list of the towns and cities in New Zealand. The list is free for all to use for any purpose. The original data was sourced from Wikipedia on Saturday 31 January 2008….

Read More »

SHA256 and higher in SQL Server

As part of a new project I’m doing, I needed to use hashes. A good source of information on hashes is available from wikipedia. SQL has the built in function HASHBYTES but this only supports up to the…

Read More »

SQL Tips – List of US States

Here is SQL and a tab delimited list of the States of the USA for all to use. The original data was sourced from Wikipedia. Please post a comment if you find this useful. Edit: I’ve beed advised…

Read More »

SQL Tips – List of Countries

This data was published in 2009 and is understandably out of date. Click here for an updated (2018) revision. Here is SQL and a tab delimited list of Countries for all to use. The original data was sourced…

Read More »

SQL Tips – List of International Dialling Codes (IDC's)

I’ve been working on a new project and needed a list of International Dialling Codes to insert into my database. Here are the results of my work for all to use. The list is supplied as SQL and…

Read More »

SQL Tips – Saving Changes Not Permitted

If you’re new to SQL 2008, you’ve probably seen the following message: The error reads: Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made…

Read More »

SQL Performance – Using LOWER() on case insensitive collations

Take a look at the following SQL. SELECT firstName, lastName FROM tUsers WHERE LOWER(firstName) = ‘john’SELECT firstName, lastName FROM tUsers WHERE LOWER(firstName) = ‘john’ The above SQL is Syntactically correct. But, and this is a big but, unless…

Read More »