If you want to set the dateformat to some style say, ddMMyyyy, in sql server we can use the following statement:
SET DATEFORMAT dmy
My question is how to know before hand that this is the format set?
The program I am writing needs to determine, if the above is the actual datetimeformat, else set it and continue with rest of execution.
How is this possible? Else is my only approach, to set it to my desired format and continue with execution?
I hope setting this won't affect other sessions (connections)?
To check the date format use
DBCC useroptions
SET DATEFORMAT
will only effect the current session
MSDN Link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With