Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
please help,
how to change the default date format of sql server 2008 to dd/mm/yyyy format



thanks in advance
Posted

hiii

just Execute Commands as below

SET DATEFORMAT dmy;

to see changes
dbcc useroptions
 
Share this answer
 
 
Share this answer
 
Comments
Maciej Los 29-May-12 12:39pm    
Great! My 5!
Sandeep Mewara 29-May-12 14:12pm    
Thanks.
just changed language to britan english
object Explorer=> security=> logins=>(user)=>Default language= Britan english
 
Share this answer
 
Comments
Nelek 29-May-12 17:38pm    
That might solve it for now, but it is not a consistant solution. I would recommend you to have a look to the links Sandeep gave you.
EXEC sp_configure 'default language', '23';
go
RECONFIGURE
GO
 
Share this answer
 
It,s very simple just write the following query to get the default date in dd/mm/yyyy.

select convert(varchar,convert(datetime,getdate(),105),103).

Hope this help you thanks.
 
Share this answer
 
using the convert method you can do it easily. Run the Follwing Query.
SELECT CONVERT(VARCHAR(8), GETDATE(), 1) AS [MM/DD/YY]
 
Share this answer
 
v2
Comments
Davidduraisamy 8-Mar-13 4:02am    
he is asking about default dateformat...so this is correct---- SET DATEFORMAT dmy;
SET DATEFORMAT mdy

CHECK USING

DBCC UserOptions
 
Share this answer
 
SQL
SELECT CONVERT(VARCHAR(10), GETDATE(), 103) AS [MM/DD/YY]
 
Share this answer
 
SELECT convert(varchar,getdate(),103)

This query will solve your problem....
 
Share this answer
 
if you want to change default sql date format into dd/MM/yyyy


use
SELECT convert(varchar(10),getdate(),103)


or you can get any date format if you have default sql date format

URL: SQL Server Functions that helps to convert date and time values to and from string literals and other date and time formats.[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900