SQL Server Performance

Change date of SQL Server to: DD/MM/YY

Discussion in 'General DBA Questions' started by Guy22, Aug 26, 2006.

  1. Guy22 New Member


    Can any one help me out with my SQL Server-problem: To change the current SQL Server date, right now it is: MM/DD/YY. I want to make it correct... DD/MM/YY, so can some one please help me out in telling me where i can change this on my server,

    Thanx, heapz

  2. deepakontheweb New Member

    You can use SET DATEFORMAT it sets the order of the dateparts (month/day/year) for entering datetime or smalldatetime data. <br /><br />Syntax<br />---------------<br />SET DATEFORMAT { format | @format_var } <br /><br /><br />SET DATEFORMAT mdy<br />GO<br />DECLARE @datevar datetime<br />SET @datevar = '12/31/98'<br />SELECT @datevar<br />GO<br /><br />SET DATEFORMAT ydm<br />GO<br />DECLARE @datevar datetime<br />SET @datevar = '98/31/12'<br />SELECT @datevar<br />GO<br /><br />SET DATEFORMAT ymd<br />GO<br />DECLARE @datevar datetime<br />SET @datevar = '98/12/31'<br />SELECT @datevar<br />GO<br /><br /><br />-- Thanks to SQL BOL [<img src='/community/emoticons/emotion-1.gif' alt=':)' />] again..<br /><br /><br /><b>Deepak Kumar</b><br /><font size="1">MVP, MCDBA - SQL Server<br /><br />Disclaimer: This post is provided as is with no rights & warranty for accuracy, for the sake of knowledge sharing only.</font id="size1">
  3. Guy22 New Member

    O thanx heapz man, ill give it a shot!

  4. khtan New Member

    It is better to specify date in universal format YYYYMMDD as it is ambiguous

  5. FrankKalis Moderator

  6. Guy22 New Member

    Thanx, but "WHERE DO YOU EXACTLY GO" to change the: MM/DD/YY format t: DD/MM/YY?

  7. Madhivanan Moderator

    quote:Originally posted by Guy22

    Thanx, but "WHERE DO YOU EXACTLY GO" to change the: MM/DD/YY format t: DD/MM/YY?

    Dont worry on how dates are stored in the table. Use front end application to format it to the way you want


    Failing to plan is Planning to fail
  8. satya Moderator

    You should have get a better understanding after reading Frank's articles.

    Satya SKJ
    Microsoft SQL Server MVP
    Contributing Editor & Forums Moderator
    This posting is provided AS IS with no rights for the sake of knowledge sharing.

Share This Page