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 2005 Forums
 SQL Server Administration (2005)
 Change Default Date Format

Author  Topic 

nice123ej
Starting Member

48 Posts

Posted - 2010-08-30 : 08:41:20
Hi
is there any way in SQL Server i can change the DateTime format to accept dd/mm/yyyy as date format

so when users run this script they dont get error

declare @dt datetime
set @dt = '28/10/2009'
select @dt


what i want is to know how change the sql server so it can understand that the string with dd/mm/yyyy format is the right format for date and accept it

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-08-30 : 09:54:01
you need to change language setting to British English or use

SET DATEFORMAT dmy

for that. why dont you pass dates always in universally accepted iso format? (YYYYMMDD)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -