Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 how to parmanetly set date format to ddmmyyyy

Author  Topic 

shershah
Starting Member

2 Posts

Posted - 2009-03-28 : 07:32:29
hi
i m new on sql server and i m using sql server 2008 in this default date format is yyyymmdd but i want to set default date format ddmmyyyy
how can i do this parmanent

cshah1
Constraint Violating Yak Guru

347 Posts

Posted - 2009-03-28 : 11:17:51
DateTime values in SQL Server are stored internally as two 4-byte integer for the datetime datatype.
So you can change formatting in the presentatin layer OR

>>how can i do this parmanent
for server settings use sp_configure to set the
default language to British or Hindi (not sure)


Go to Top of Page

cshah1
Constraint Violating Yak Guru

347 Posts

Posted - 2009-03-28 : 11:21:44
Here you go

http://support.microsoft.com/kb/173907
Go to Top of Page

r.amutha
Starting Member

6 Posts

Posted - 2009-04-30 : 04:31:17
Hi friend, 'Try this query'
Declare @d datetime
select @d = getdate()

select @d,convert(varchar,@d,103),103,'dd/mm/yy'
union all
select @d,convert(varchar,@d,104),104,'dd.mm.yy'
union all
select @d,convert(varchar,@d,105),105,'dd-mm-yy'
union all
select @d,convert(varchar,@d,106),106,'dd mon yy'
union all
select @d,convert(varchar,@d,107),107,'Mon dd, yy'
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-04-30 : 05:07:31
Dont worry how dates are stored in the table. In the front end application, use format function to show in the required format

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -