Solved

Restructuring SQL queries according to SQL database Locale Settings

Posted on 2001-08-06
3
185 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
  • 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 Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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 …
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.
This video discusses moving either the default database or any database to a new volume.

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now