Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to change date format in sql server 2008 r2 for all sessions? Expand / Collapse
Author
Message
Posted Wednesday, November 28, 2012 2:25 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, November 5, 2014 3:40 AM
Points: 1,608, Visits: 381
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..
Post #1389588
Posted Wednesday, November 28, 2012 2:46 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, December 1, 2014 7:30 AM
Points: 2,128, Visits: 5,565
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/
Post #1389596
Posted Wednesday, November 28, 2012 3:00 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, November 5, 2014 3:40 AM
Points: 1,608, Visits: 381
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.
Post #1389605
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse