SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Change Default Date Format
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

nice123ej
Starting Member

48 Posts

Posted - 08/30/2010 :  08:41:20  Show Profile  Reply with Quote
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

India
52249 Posts

Posted - 08/30/2010 :  09:54:01  Show Profile  Reply with Quote
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/


Edited by - visakh16 on 08/30/2010 09:56:14
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000