Feb
07
2009
0

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')

Written by John Burns in: SQL Tips |
Feb
05
2009
2

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 5 February 2008.

If you need to modify it further, remember that you can always use The Worlds Simplest Code Generator.

In the SQL version, the following have been escaped with an extra single quote:

  • Cote d’Ivoire
  • Korea, Democratic People’s Republic of
  • Lao People’s Democratic Republic

Please post a comment if you find this useful.
(more…)

Written by John Burns in: SQL Tips |
Jan
31
2009
0

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.

If you need to modify it further, remember that you can always use The Worlds Simplest Code Generator.

Please post a comment if you find this useful.
(more…)

Written by John Burns in: SQL Tips |
Jan
29
2009
0

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 SHA128 algorithm and I want to use SHA256.

I created myself a CLR in C#.net and in some moment of feeling generous, decided to share the code.

(more…)

Written by John Burns in: SQL Tips |
Jan
24
2009
0

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 that although it’s not technically a state, this list needs District of Columbia as most real world scenarios require it. It’s been added to the top of the list.

(more…)

Written by John Burns in: SQL Tips |
Jan
23
2009
0

SQL Tips – List of Countries

Here is SQL and a tab delimited list of Countries for all to use.

The original data was sourced from Wikipedia.

Note that some countries have single quotes in their names, these need to be escaped for SQL. The SQL I’m supplying is escaped, but the tab delimited version is not.

Please post a comment if you find this useful.

(more…)

Written by John Burns in: SQL Tips |