<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Determine primary keys and unique keys for all tables in a database...</title><link>http://blogs.msdn.com/b/sqltips/archive/2005/09/16/469136.aspx</link><description>Determine primary keys and unique keys for all tables in a database using INFORMATION_SCHEMA views and the new catalog views in SQL Server 2005</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title> SQL Server Engine Tips Determine primary keys and unique keys for all | patio set</title><link>http://blogs.msdn.com/b/sqltips/archive/2005/09/16/469136.aspx#9784789</link><pubDate>Fri, 19 Jun 2009 13:19:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9784789</guid><dc:creator> SQL Server Engine Tips Determine primary keys and unique keys for all | patio set</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://patiosetsite.info/story.php?id=1006"&gt;http://patiosetsite.info/story.php?id=1006&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9784789" width="1" height="1"&gt;</description></item><item><title>T-SQL: Determine primary keys and unique keys for all tables in a database...</title><link>http://blogs.msdn.com/b/sqltips/archive/2005/09/16/469136.aspx#754689</link><pubDate>Thu, 14 Sep 2006 23:58:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:754689</guid><dc:creator>Little Tidbits of Random Knowledge</dc:creator><description>&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=754689" width="1" height="1"&gt;</description></item><item><title>T-SQL: Determine primary keys and unique keys for all tables in a database...</title><link>http://blogs.msdn.com/b/sqltips/archive/2005/09/16/469136.aspx#754644</link><pubDate>Thu, 14 Sep 2006 23:26:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:754644</guid><dc:creator>Little Tidbits of Random Knowledge</dc:creator><description>&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=754644" width="1" height="1"&gt;</description></item><item><title>re: Determine primary keys and unique keys for all tables in a database...</title><link>http://blogs.msdn.com/b/sqltips/archive/2005/09/16/469136.aspx#754556</link><pubDate>Thu, 14 Sep 2006 22:29:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:754556</guid><dc:creator>Manfred Mejías</dc:creator><description>thks :o)&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=754556" width="1" height="1"&gt;</description></item><item><title>re: Determine primary keys and unique keys for all tables in a database...</title><link>http://blogs.msdn.com/b/sqltips/archive/2005/09/16/469136.aspx#754488</link><pubDate>Thu, 14 Sep 2006 21:46:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:754488</guid><dc:creator>SQL Server Engine Team</dc:creator><description>The INFORMATION_SCHEMA.KEY_COLUMN_USAGE is a known issue / bug for SQL Server 2000. We have fixed it in SQL Server 2005. You will have to workaround it in SQL Server 2000 by writing queries against the system tables instead.&lt;br&gt;&lt;br&gt;--&lt;br&gt;Umachandar&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=754488" width="1" height="1"&gt;</description></item><item><title>re: Determine primary keys and unique keys for all tables in a database...</title><link>http://blogs.msdn.com/b/sqltips/archive/2005/09/16/469136.aspx#754465</link><pubDate>Thu, 14 Sep 2006 21:30:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:754465</guid><dc:creator>Manfred Mejías</dc:creator><description>With Sqlserver 2000 we have a little problem if we don't use dbo user. &amp;nbsp;For example, we have two user with SQL Server authentication, Manfred and Alexis and create the &amp;quot;Sales&amp;quot; database. &amp;nbsp;So, we have the table Deparment in each user. &amp;nbsp;If the user dbo uses the INFORMATION_SCHEMA.KEY_COLUMN_USAGE view it don't see the primary keys, but, if we use the user Manfred we can see it.&lt;br&gt;&lt;br&gt;We edit the INFORMATION_SCHEMA.KEY_COLUMN_USAGE view and changed one line index_col(t_obj.name,i.indid,v.number) with index_col(user_name(t_obj.uid)+'.'+t_obj.name,i.indid,v.number) and it works, why do you think?&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=754465" width="1" height="1"&gt;</description></item><item><title>re: Determine primary keys and unique keys for all tables in a database...</title><link>http://blogs.msdn.com/b/sqltips/archive/2005/09/16/469136.aspx#694438</link><pubDate>Thu, 10 Aug 2006 18:30:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:694438</guid><dc:creator>Chris</dc:creator><description>Great! Thanks! This is exactly what I was looking for. I like that it just works and I don't have to understand it ;)&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=694438" width="1" height="1"&gt;</description></item></channel></rss>