Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 sql query

Author  Topic 

psangeetha
Yak Posting Veteran

95 Posts

Posted - 2010-09-07 : 11:31:53
Hi all,

I'm trying to find the table columns that have wrong collation.. THe sql below gives the column names and the collation but I need the table names also.. Any help please?

SELECT c.name, c.collation_name
FROM sys.columns c
WHERE c.OBJECT_ID IN ( SELECT OBJECT_ID
FROM sys.objects o
WHERE o.type = 'U')
GO

Thank you

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-09-07 : 13:11:51
SELECT o.name as tablename,c.name as colname, c.collation_name
FROM sys.columns c
join sys.objects o on o.OBJECT_ID = c.OBJECT_ID
and o.type = 'U'



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -