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] | "Chris Stolte" <cstolte@graphics.stanford.edu> wrote in message
| news:98086226.0410220714.20ad4ed2@posting.google.com...
| > 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
|
|
|