How can I query the database culture (SQL Server 2005) ?
I have problems inserting and getting dates, because the client’s servers don’t run on the same culture as my developer server.
I can adjust the date, but I need to know the server’s culture…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can find out about the currently configured language using this:
and you might also want to check out this:
It will show the available languages, and what date formats etc. they have. This is basically the contents of the
sys.syslanguagessystem catalog table.As for date handling – preferably use DateTime based parametrized queries, or if you have to have date strings, use the ISO-8601 date format in SQL Server.
The format
YYYYMMDDorYYYYMMDD HH:MM:SSwill always work, regardless of currently selected language settings in SQL Server.