Hello,
Can someone tell me how to get the default dateformat for a sql server?
The reason is that I have a stored proceure used to work fine, but it
stopped working this morning.
I checked and found out that if I use US dateformat then it will be fine. I
do want to find out the default dateformat for the server and possibly when
it get changed since it was OK.
hello, please helpALWAYS use YYYYMMDD rather than any regional or language specific date
format. Then you don't have to worry about DATEFORMAT at all, since humans
and software can not misinterpret it no matter what.
You can check using DBCC USEROPTIONS but this is user- or session-specific
information, and can be overriden by any user as they are connected.
A
"jerry.xuddd" <jerryxuddd@.discussions.microsoft.com> wrote in message
news:6482818F-CF80-4187-A179-7C14D39A561F@.microsoft.com...
> Hello,
> Can someone tell me how to get the default dateformat for a sql server?
> The reason is that I have a stored proceure used to work fine, but it
> stopped working this morning.
> I checked and found out that if I use US dateformat then it will be fine.
> I
> do want to find out the default dateformat for the server and possibly
> when
> it get changed since it was OK.
> --
> hello, please help|||Hi,
Can you tell me how to set and get the dateformat for a sql server? I
checked the regional setting for windows and it is set to UK, not US.
Thanks
--
hello, please help
"Aaron Bertrand [SQL Server MVP]" wrote:
> ALWAYS use YYYYMMDD rather than any regional or language specific date
> format. Then you don't have to worry about DATEFORMAT at all, since human
s
> and software can not misinterpret it no matter what.
> You can check using DBCC USEROPTIONS but this is user- or session-specific
> information, and can be overriden by any user as they are connected.
> A
>
>
> "jerry.xuddd" <jerryxuddd@.discussions.microsoft.com> wrote in message
> news:6482818F-CF80-4187-A179-7C14D39A561F@.microsoft.com...
>
>|||To set it:
SET DATEFORMAT dmy
or
SET DATEFORMAT mdy
To get it, you will have to call DBCC USEROPTIONS, like I said before, and
examine the dateformat row. Keep in mind that this setting can be different
for different users, even if they are connected to SQL Server at the same
time.
However, the only *SOLUTION* is to use dateformat-, region- and
language-independent date formats (such as YYYYMMDD).
"jerry.xuddd" <jerryxuddd@.discussions.microsoft.com> wrote in message
news:E520DAAB-1B74-42DE-9D06-610414017795@.microsoft.com...
> Hi,
> Can you tell me how to set and get the dateformat for a sql server? I
> checked the regional setting for windows and it is set to UK, not US.
>
> Thanks
> --
> hello, please help
>
> "Aaron Bertrand [SQL Server MVP]" wrote:
>
No comments:
Post a Comment