> I think if you use #01/11/2004# syntax in MS SQL, this will always mean
>
> 11th day of January
>
> irrespective of any locale settings.
No, this is incorrect on at least two counts.
(1) SQL Server will barf on # as delimiters. Run this in Query Analyzer:
DECLARE @dt SMALLDATETIME
SET @dt = #01/11/2004#
You will get this:
Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near '#'.
(2) SQL Server will certainly *NOT* always interpret 01/11/2004 as January
11th. Even if you have a US locale and set up SQL Server as US English,
feel free to run this simple repro in Query Analyzer:
SET LANGUAGE FRENCH
GO
SELECT DATENAME(MONTH, '01/11/2004')
SET LANGUAGE ENGLISH
GO
Let us know if you get janvier or novembre!
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/