This has now been posted to Connect: The invariant culture identifier is rejected by the FORMAT() function in SQL Server 2012.
I'm trying to get the built-in
format() function in SQL Server 2012 to use the invariant culture.
It is said in the documentation that the function accepts a .NET culture identifier as the third parameter. The identifier for the invariant culture is a blank string:
You specify the invariant culture by name by using an empty string (
"") in the call to a
That does not work with SQL Server however:
select format(getdate(), N'g', '');
Msg 9818, Level 16, State 1, Line 1
The culture parameter '' provided in the function call is not supported.
It is also documented that the invariant culture is associated with the English language, but not with any country/region. One would think this allows to pass
'en' as the identifier, but then, in .NET,
false, so they aren't really the same.
So how do I make SQL Server to use the invariant culture?
(Note: I'm interested in making the built-in thing to work. I already have my own CLR functions to do this, I was going to remove them in favor of the now-built-in functionality).
Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (X64)
Dec 28 2012 20:23:12
Copyright (c) Microsoft Corporation
Business Intelligence Edition (64-bit) on Windows NT 6.0 (Build 6002: Service Pack 2) (Hypervisor)