|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 10:44 PM
Points: 1,143,
Visits: 229
|
|
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..
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 9:50 AM
Points: 2,019,
Visits: 4,923
|
|
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/
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 10:44 PM
Points: 1,143,
Visits: 229
|
|
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.
|
|
|
|