Solved

Restructuring SQL queries according to SQL database Locale Settings

Posted on 2001-08-06
3
195 Views
Last Modified: 2013-11-20
I have a client app (written in C++) that uses ADO to retrieve records from a SQL 7 server database table.  The query performed uses datetime values as parameters in the format dd/mm/yyyy.  The locale of the SQL Server table that I am accessing is US English.  Consequently, when I perform queries using my app, no results are returned because the app month and day values are the wrong way round for the database table.

I was wondering whether there is a way of finding out (using code) what locale setting the SQL Server database is currently configured to, so that I can adjust the datetime parameters in the query in my app from dd/mm/yyyy to mm/dd/yyyy.
0
Comment
Question by:carlpaddick
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
missionImpossible earned 100 total points
ID: 6356022
there are two system tables in your db where you (maybe) can find out which language is set:

the table syscolumns: column 'language' you can ask each column of your tables for the language set.

the table syscomments: column 'language' you can ask each object for its language (I've never used it)

for ex: select language from syscolumns where name  = 'YourColumnName'


0
 

Author Comment

by:carlpaddick
ID: 6356224
Thanks missionimpossible,

Mission accomplished
0
 
LVL 2

Expert Comment

by:missionImpossible
ID: 6358452
you're welcome!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sumNumber challenge 16 147
Hibernate methods 2 87
bigDiff challenge 17 142
Modbus - whats the maximum I can store in one register? 4 84
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question