SQL server date format issue – kind of

So you find yourself that your software was written for say UK English but the system is installed from US English. This can happen in numerous cloud migration projects. Well the issue can be overcome in several ways but one way that I liked in particular is to alter the user’s default language. This assumes something like web site project that uses SQL server as it’s DB store.

All you need to do to alter one users language is:

use master
EXEC sp_defaultlanguage 'fred', 'British'
GO

What this provides is for various sites using the same SQL server but providing various cultural date inputs (plus associated other functions) to be valid. Thus one web site could use US from of MM/DD/YY while another site using differnt DB logon could now use UK format that allows dates to be input as DD/MM/YY.

Cheers!

Print Friendly, PDF & Email