How to change date format in sql server 2008 r2 for all sessions?

  • How to change date format in sql server 2008 r2 for all sessions?

    I tried,

    EXEC sp_configure 'default language', '23';

    go

    RECONFIGURE

    GO

    DBCC USEROPTIONS

    GO

    select * from sys.syslanguages

    go

    SET dateformat DMY

    GO

    But none have worked for all sessions..

  • Using sp_configure to modify the default language will work on new logins that will be created without specifying the logins' default language. It will not modify an existing login.

    Using SET DATEFORMAT statement works only in the session that issued this statement, so it will not modify the date format for existing logins or existing sessions.

    You can modify all logins to have default language 23, so next time that they will login, they will get the date format that you want, but this will also affect other staff such as the language of error messages, etc' (since 23 is British English and I assume that you have American English, it might be O.K for you). In any case I don't think that SQL server should format the dates. This is something that should be done by the GUI. What will happen if you'll have one login that should use 2 different databases and each application would trust that the login has different date format (e.g. one can work with British format and the other one with American format)?

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • To

    Adi Cohn-120898

    Thanks for text.. i agree and conclude it should handle from gui side as it is not advisable to change all logins by different language.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply