SQL Server: changing the date for each connection

Can I change dateformatfrom DMY to YMD only for new connections?

I tried the LOGON trigger with SET DATEFORMAT YMD, but DMY always returns by default.

Therefore, I want to save the default DMY to the database, but for new sessions (connections) that I want to change for YMD.

+4
source share
1 answer

I believe that it is tied to the language of your server, which you can see as follows:

USE [master]
GO

SELECT * FROM [syslanguages]

then you need to run sp_config with langid from the first request

EXEC sp_configure 'default language', 'langid'
GO;
RECONFIGURE
GO;
0
source

Source: https://habr.com/ru/post/1689595/


All Articles