﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Rafal S.  / Show all database's tables' columns' collations. / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 15:20:34 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Show all database's tables' columns' collations.</title><link>http://www.sqlservercentral.com/Forums/Topic449074-1184-1.aspx</link><description>to get the collation of a column of a tableselect COLLATION_NAMEfrom information_schema.columns-- you complete this bit as necessarywhere table_name like '%'and column_name like '%'  or have I missed something?pcd</description><pubDate>Fri, 04 Apr 2008 03:20:04 GMT</pubDate><dc:creator>pcd_au</dc:creator></item><item><title>RE: Show all database's tables' columns' collations.</title><link>http://www.sqlservercentral.com/Forums/Topic449074-1184-1.aspx</link><description>Hmm ...Right.My oversight.Sorry for that.</description><pubDate>Fri, 04 Apr 2008 02:46:28 GMT</pubDate><dc:creator>skra</dc:creator></item><item><title>RE: Show all database's tables' columns' collations.</title><link>http://www.sqlservercentral.com/Forums/Topic449074-1184-1.aspx</link><description>I had to add COLLATE Database_Default, in order to get it to work.As in:/********************************************************************************************* * Author Rafal Skotak* Purpose Created view displays all text columns' collations in the current database,* with the name of table which contains the column andwith the information whether* the collation is different from the database's one* Date 2008-01-22*/if exists(select * from sys.objects where object_id = object_id('dbo.view_show_tables_collations') and type = 'V')	drop view dbo.view_show_tables_collationsgocreate view dbo.view_show_tables_collationsas select top 9223372036854775807 /* bigint maximum value; to cheat SS2005 You can try also 99.999999999999999999999999 percent */	ss.name as schema_name,	so.name as table_name,	sc.name as column_name,	st.system_type_id,	st.name as type_name,	db_collation.collation_name as database_collation_name,	sc.collation_name,	case 	when db_collation.collation_name = sc.collation_name [b]COLLATE database_default[/b] then 0	else 1	end as collation_flagfrom	sys.objects as so inner join	sys.columns as sc on		so.object_id = sc.object_id inner join	sys.types as st on		sc.system_type_id = st.system_type_id inner join	sys.schemas as ss on		ss.schema_id = so.schema_id cross join	(select collation_name from master.sys.databases where database_id = db_id()) as db_collationwhere	so.type = 'U' and 	st.system_type_id in (35 /* text */, 99 /* ntext */, 167 /* varchar */, 175 /* char */, 231 /* nvarchar, sysname */, 239 /* nchar */)order by	collation_flag desc,	schema_name,	table_name,	column_namego-- example, how to use:select * from dbo.view_show_tables_collations</description><pubDate>Fri, 04 Apr 2008 02:31:39 GMT</pubDate><dc:creator>henrik staun poulsen</dc:creator></item><item><title>RE: Show all database's tables' columns' collations.</title><link>http://www.sqlservercentral.com/Forums/Topic449074-1184-1.aspx</link><description>i awant all the table in database</description><pubDate>Fri, 28 Mar 2008 21:22:51 GMT</pubDate><dc:creator>lavkushsharma</dc:creator></item><item><title>Show all database's tables' columns' collations.</title><link>http://www.sqlservercentral.com/Forums/Topic449074-1184-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/Miscellaneous/62042/"&gt;Show all database's tables' columns' collations.&lt;/A&gt;[/B]</description><pubDate>Tue, 29 Jan 2008 13:51:19 GMT</pubDate><dc:creator>skra</dc:creator></item></channel></rss>