Wednesday, March 7, 2012

Date format change in the server

Hi,
Can anyone help me to solve this query regarding Date format in SQL Server
Is it possible to change the Date format in the SQL Database server. Is
this dependent upon the system date settings in the Control Panel.
Regards,
VB BabunathHi
SQL Server stores the data an a number and does not care about the setting
at OS level. Date format display is determined by the client and has
nothing to do with the server.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"VBB" <VBB@.discussions.microsoft.com> wrote in message
news:A2D2D692-6699-4EF2-B0E7-C75B9E1609D5@.microsoft.com...
> Hi,
> Can anyone help me to solve this query regarding Date format in SQL Server
> Is it possible to change the Date format in the SQL Database server. Is
> this dependent upon the system date settings in the Control Panel.
> Regards,
> VB Babunath|||See "set dateformat" in BOL, but better use ISO format (see convert function
,
styles 112 and 126), because sql server will always interpret the values as
datetime, independently of the language and "set dateformat" setting.
Example:
set dateformat mdy
go
select cast('20050922' as datetime)
go
-- error
select cast('22/09/2005' as datetime)
go
set dateformat dmy
go
select cast('20050922' as datetime)
go
-- error
select cast('09/22/2005' as datetime)
go
AMB
"VBB" wrote:

> Hi,
> Can anyone help me to solve this query regarding Date format in SQL Server
> Is it possible to change the Date format in the SQL Database server. Is
> this dependent upon the system date settings in the Control Panel.
> Regards,
> VB Babunath|||The question is very broad. I suggest you start by reading
http://www.karaszi.com/SQLServer/info_datetime.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"VBB" <VBB@.discussions.microsoft.com> wrote in message
news:A2D2D692-6699-4EF2-B0E7-C75B9E1609D5@.microsoft.com...
> Hi,
> Can anyone help me to solve this query regarding Date format in SQL Server
> Is it possible to change the Date format in the SQL Database server. Is
> this dependent upon the system date settings in the Control Panel.
> Regards,
> VB Babunath

No comments:

Post a Comment