all groups > sql server odbc > october 2004 >
You're in the

sql server odbc

group:

OLE DB or ODBC collation information


OLE DB or ODBC collation information cstolte NO[at]SPAM graphics.stanford.edu
10/22/2004 8:14:58 AM
sql server odbc:
Good morning.

We are building a SQL Server client in C++ and out client needs to be
able to dynamically discover collation information about result set
columns and existing table columns. We'd like to be able to map that
collation back to an LCID in Win32. Does anyone know the proper
properties or interfaces to use to obtain this information?

Re: OLE DB or ODBC collation information Michael Thomas (Microsoft)
10/22/2004 9:21:33 AM
You can use a system store procedure:

exec [<database>]..sp_tablecollations '[<schema>].[<tablename>]'



Michael


[quoted text, click to view]

Re: OLE DB or ODBC collation information bartd NO[at]SPAM online.microsoft.com
10/25/2004 4:32:39 PM
And to map a collation to an LCID:

SELECT COLLATIONPROPERTY ('<collation_name>', 'LCID')

To do this in one query instead of submitting the above for each of the
columns returned by sp_tablecollations:

USE pubs
GO
SELECT COLUMN_NAME, DATA_TYPE, COLLATION_NAME,
COLLATIONPROPERTY (COLLATION_NAME, 'LCID') AS LCID
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_CATALOG = 'pubs' AND TABLE_SCHEMA = 'dbo' AND TABLE_NAME =
'authors'

Bart
------------
Bart Duncan
Microsoft SQL Server Support

Please reply to the newsgroup only - thanks.
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| From: "Michael Thomas \(Microsoft\)" <mithomas@online.microsoft.com>
| References: <98086226.0410220714.20ad4ed2@posting.google.com>
| Subject: Re: OLE DB or ODBC collation information
| Date: Fri, 22 Oct 2004 09:21:33 -0700
| Lines: 22
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.181
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.181
| Message-ID: <eMH94MFuEHA.1372@TK2MSFTNGP14.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.odbc
| NNTP-Posting-Host: tide138.microsoft.com 131.107.71.95
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14
.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.odbc:42809
| X-Tomcat-NG: microsoft.public.sqlserver.odbc
|
| You can use a system store procedure:
|
| exec [<database>]..sp_tablecollations '[<schema>].[<tablename>]'
|
|
|
| Michael
|
|
[quoted text, click to view]
| > Good morning.
| >
| > We are building a SQL Server client in C++ and out client needs to be
| > able to dynamically discover collation information about result set
| > columns and existing table columns. We'd like to be able to map that
| > collation back to an LCID in Win32. Does anyone know the proper
| > properties or interfaces to use to obtain this information?
| >
| > Thanks
|
|
|
AddThis Social Bookmark Button