These are the articles in our Databases and SQL section.

New articles are added from time to time, so be sure to visit again.

For topical items, updates and readers' comments, please visit the Hex Central Blog.

We welcome your feedback. Please contact us with your suggestions, questions or comments.

DATABASES AND SQL

How to generate realistic test data

Use these simple SQL scripts to produce fictitious (but realistic) data for testing your applications.

Parsing and validating UK postcodes in SQL Server

We explain the syntax and formatting rules for UK postal codes - and show some T-SQL queries for extracting the codes from your address data and checking they're in the correct format.

How to programmatically calculate the distance between two UK postcodes

Calculating distances in the UK is easy, thanks to the National Grid, a postcode lookup table, and a dash of Pythagoras.

Find the IDENTITY value of the last inserted row (SQL Server)

@@IDENTITY, SCOPE_IDENTITY() or IDENT_CURRENT()? What's the difference? And which one should you use?

Validating UK National Insurance (NI) numbers

How to programmatically check the format of NI numbers, with example code for SQL Server, Visual FoxPro and JavaScript.

If you found this page useful, please share it: