From: Alur on
How can I determine current
SET DATEFORMAT ?
From: Martin C K Poon on
DBCC USEROPTIONS

--
Martin C K Poon
Senior Analyst Programmer
====================================
"Alur" <Alur(a)discussions.microsoft.com> ?b?l??
news:D2C70A61-AD21-4EFE-A945-5A7A72EBF6B7(a)microsoft.com ?????g...
> How can I determine current
> SET DATEFORMAT ?


From: Derekman on

If you haven't localized SQL Server for your language, the default date
format is the American one: DD/MM/YY.

Use
SELECT GETDATE() and this will show you the default currently.

"Alur" wrote:

> How can I determine current
> SET DATEFORMAT ?
From: Tibor Karaszi on
> SELECT GETDATE() and this will show you the default currently.

No, the presentation of datetime has no correlation of how input of datetime strings are
interpreted. See http://www.karaszi.com/SQLServer/info_datetime.asp for more information.


--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/


"Derekman" <Derekman(a)discussions.microsoft.com> wrote in message
news:23BB0F57-2A93-4E20-95C8-7E5038756D51(a)microsoft.com...
>
> If you haven't localized SQL Server for your language, the default date
> format is the American one: DD/MM/YY.
>
> Use
> SELECT GETDATE() and this will show you the default currently.
>
> "Alur" wrote:
>
>> How can I determine current
>> SET DATEFORMAT ?

From: Kalen Delaney on
Sorry, Derekman, but this is not correct.

The American format, the default, is MDY.

Also, GETDATE() has nothing to do with DATEFORMAT.

DATEFORMAT shows you how SQL Server interprets incoming strings as dates.
For example, if you ask it to convert '3/4/06' to a datetime, will it be
April 3rd or March 4th?
SELECT CONVERT(datetime, '3/4/06')

DATEFORMAT tells SQL Server how to interpret a string that has all numbers,
which number is the month,
which is day and which is year. For the default MDY, it means the first
number is month, so '3/4/06' would be March 4th.

GETDATE returns the current date and time in a default output format, which
is based on your regional settings.
To DISPLAY a datetime in another format, you need to convert it to a string,
and specify a style. You can see the different styles available if you read
about CONVERT in the Books Online.

--
HTH
Kalen Delaney, SQL Server MVP


"Derekman" <Derekman(a)discussions.microsoft.com> wrote in message
news:23BB0F57-2A93-4E20-95C8-7E5038756D51(a)microsoft.com...
>
> If you haven't localized SQL Server for your language, the default date
> format is the American one: DD/MM/YY.
>
> Use
> SELECT GETDATE() and this will show you the default currently.
>
> "Alur" wrote:
>
>> How can I determine current
>> SET DATEFORMAT ?