Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Restructuring SQL queries according to SQL database Locale Settings

Posted on 2001-08-06
3
Medium Priority
?
198 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 400 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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 …
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.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

705 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