Hi All,
I want to set Date format as British (i.e. dd/MM/yyyy 30/11/2005) in my
Database. What I will have to do for this.
TIAhi Kamal,
Kamal Ahmed wrote:
> Hi All,
> I want to set Date format as British (i.e. dd/MM/yyyy 30/11/2005) in
> my Database. What I will have to do for this.
>
this "setting" is login's related, that's to say it depend on the login's
language property, but it can be set using
SET DATEFROMAT xxx
(http://msdn.microsoft.com/library/d.../>
et_052s.asp)
for input...
please have a look at http://www.karaszi.com/SQLServer/info_datetime.asp
too..
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.16.0 - DbaMgr ver 0.61.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply|||Hopefully following posting can help you:
http://www.microsoft.com/technet/co...r />
96A551&ca
tlist=328BAFD2-1A81-4558-B1DE-B6EB49F31B7E&dglist=&ptlist=&exp=&sloc=en-us
"Kamal Ahmed" wrote:
> Hi All,
> I want to set Date format as British (i.e. dd/MM/yyyy 30/11/2005) in my
> Database. What I will have to do for this.
> TIA
>
>|||Kamal Ahmed wrote:
> Hi All,
> I want to set Date format as British (i.e. dd/MM/yyyy 30/11/2005) in my
> Database.
Why? DATEFORMAT is set in each connection so the database setting is
pretty redundant. Best practice is to ignore the DATEFORMAT setting and
write code that performs correctly however this may be set. Crucially
this means that any hard-coded dates should be coded in ISO rather than
local format:
'YYYYMMDD'
or
'YYYY-MM-DDThh:mm:ss'
or
'YYYY-MM-DDThh:mm:ss.mmm'
All other date values should be handled as DATETIME or SMALLDATETIME
(which are unaffected by the format setting) or converted from strings
using the CONVERT style property.
David Portas
SQL Server MVP
--
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment