Solved

Restructuring SQL queries according to SQL database Locale Settings

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

626 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