Hi all,
I am trying to use a collation query to find out any discrepencies within dbs/colums
E.g
query below gives me: SQL_Latin1_General_CP1_CI_AS
SELECT DATABASEPROPERTYEX(DB_name(), 'Collation') collation;
then I try the query below on the same database:
select collation from test where (collation != DATABASEPROPERTYEX(DB_NAME(), 'Collation'))
result:
Latin1_General_CI_AS_KS_WS
for the query to run properly I have to replace the
(collation != DATABASEPROPERTYEX(DB_NAME(), 'Collation'))
with
(collation != 'SQL_Latin1_General_CP1_CI_AS')
Is there anyways to modify the query to get the proper results without having to specify the actual collation in the query?
tried a variation without success:
declare @collation sql_variant
select @collation = DATABASEPROPERTYEX(DB_name(), 'Collation')
select collation from test where collation != @collation
many thanks
I am trying to use a collation query to find out any discrepencies within dbs/colums
E.g
query below gives me: SQL_Latin1_General_CP1_CI_AS
SELECT DATABASEPROPERTYEX(DB_name(), 'Collation') collation;
then I try the query below on the same database:
select collation from test where (collation != DATABASEPROPERTYEX(DB_NAME(), 'Collation'))
result:
Latin1_General_CI_AS_KS_WS
for the query to run properly I have to replace the
(collation != DATABASEPROPERTYEX(DB_NAME(), 'Collation'))
with
(collation != 'SQL_Latin1_General_CP1_CI_AS')
Is there anyways to modify the query to get the proper results without having to specify the actual collation in the query?
tried a variation without success:
declare @collation sql_variant
select @collation = DATABASEPROPERTYEX(DB_name(), 'Collation')
select collation from test where collation != @collation
many thanks