Re: Retrieve collation settings

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 09/20/04


Date: Mon, 20 Sep 2004 13:40:33 +0200

Yep:

SELECT DATABASEPROPERTYEX (DB_NAME(), 'collation')

-- 
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Johannes Lebek" <reply-to-newsgroup@domain.com> wrote in message
news:ONkn4VwnEHA.4004@TK2MSFTNGP10.phx.gbl...
> Hi there,
>
> my problem is that I want to know what is the collation of the database
> I connect to.
>
> I planned to use the following statement:
> SELECT DATABASEPROPERTYEX ('MyDatabase', 'collation')
>
> However, I do not know the name of that database... I connect to J2EE
> datasources using JNDI.
>
> Is there a keyword that can be used as a placeholder for the current
> database, like SELECT DATABASEPROPERTYEX (CURRENT_DATABASE, 'collation')?
>
> Any help is appreciated.
> Thanks,
>
> Johannes


Relevant Pages

  • Re: SORT ORDER SETTINGS OF DB
    ... sp_helpdb or DATABASEPROPERTYEX. ... Tibor Karaszi, SQL Server MVP ... "rikesh" wrote in message ...
    (microsoft.public.sqlserver.setup)
  • Re: Different Collations
    ... Do you know how any other way I can get the collation i want? ... > Tibor Karaszi, SQL Server MVP ... >>> Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.server)
  • Re: Different Collations
    ... Tibor Karaszi, SQL Server MVP ... >> Tibor Karaszi, SQL Server MVP ... I restore the model db with my collation (from another ...
    (microsoft.public.sqlserver.server)
  • Re: makinga database case insensitive
    ... Specify the appropriate collation when you create the database ... Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.setup)
  • Re: How do I know whether this database is published or not?
    ... select name, databasepropertyex from ... Paul Ibison SQL Server MVP, ...
    (microsoft.public.sqlserver.replication)