tsql - How do I control the format in which MS-SQL Server returns datetime values? -


Specifically, I want to get date format in a pure (ISO) format:

YYYY-MM-DD HH: mm: ss

I'm using a SET command or something that I can use.

I do not want to trust the server's culture setting.

Note: I am interested in string format in which dates have been returned, have not been entered.

To change the default format, you need to add a new language (sp_addlanguage), to date format Set it, then set it to default language

If you do not want to do this, you can change it by using "per connection".

And if you do not want to do this, you can use it to convert it to every query in the release format string.


Comments