Solved

Restructuring SQL queries according to SQL database Locale Settings

Posted on 2001-08-06
3
194 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

Industry Leaders: 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
Separate files macro - Errors on larger data set 18 73
mapAB Challlenge 35 172
firstChar challenge 13 132
Is there a simple front-end menu system. 9 118
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

735 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