SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


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?

Author
Message
Aadhar Joshi
Aadhar Joshi
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1712 Visits: 451
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..
Adi Cohn
Adi Cohn
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4509 Visits: 6515
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/
Aadhar Joshi
Aadhar Joshi
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1712 Visits: 451
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search