<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; CE &#8211; List of Information_Schema System Tables</title>
	<atom:link href="http://blog.sqlauthority.com/2011/10/02/sql-server-ce-list-of-information_schema-system-tables/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2011/10/02/sql-server-ce-list-of-information_schema-system-tables/</link>
	<description>SQL, SQL Server, MySQL, Big Data and NoSQL</description>
	<lastBuildDate>Wed, 19 Jun 2013 15:04:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Nitin</title>
		<link>http://blog.sqlauthority.com/2011/10/02/sql-server-ce-list-of-information_schema-system-tables/#comment-357821</link>
		<dc:creator><![CDATA[Nitin]]></dc:creator>
		<pubDate>Tue, 09 Oct 2012 09:50:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14727#comment-357821</guid>
		<description><![CDATA[Hii All,

I am using SQL CE... 

I have added two columns in my table Accounts (ID(PK), UpdateId , InsertId) and i have set default constraints for both with name Accounts_UpdateId_Default &amp; Accounts_InsertId_Default  but when i am using below query it showing only one constraint which system has created for ID(PK), It not showing those constraints which i have created.

SELECT     *
FROM         INFORMATION_SCHEMA.TABLE_CONSTRAINTS
WHERE     (table_name = &#039;Accounts&#039;)   

Please help me ASAP..... Thnx...]]></description>
		<content:encoded><![CDATA[<p>Hii All,</p>
<p>I am using SQL CE&#8230; </p>
<p>I have added two columns in my table Accounts (ID(PK), UpdateId , InsertId) and i have set default constraints for both with name Accounts_UpdateId_Default &amp; Accounts_InsertId_Default  but when i am using below query it showing only one constraint which system has created for ID(PK), It not showing those constraints which i have created.</p>
<p>SELECT     *<br />
FROM         INFORMATION_SCHEMA.TABLE_CONSTRAINTS<br />
WHERE     (table_name = &#8216;Accounts&#8217;)   </p>
<p>Please help me ASAP&#8230;.. Thnx&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Download Microsoft SQL Server Compact 4.0 SP1 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2011/10/02/sql-server-ce-list-of-information_schema-system-tables/#comment-347551</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Download Microsoft SQL Server Compact 4.0 SP1 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 15 Sep 2012 01:31:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14727#comment-347551</guid>
		<description><![CDATA[[...] SQL SERVER – CE – List of Information_Schema System Tables [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER – CE – List of Information_Schema System Tables [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ronak Patel</title>
		<link>http://blog.sqlauthority.com/2011/10/02/sql-server-ce-list-of-information_schema-system-tables/#comment-319371</link>
		<dc:creator><![CDATA[Ronak Patel]]></dc:creator>
		<pubDate>Thu, 26 Jul 2012 16:24:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14727#comment-319371</guid>
		<description><![CDATA[need to get by db table names , is there any sys table where it ties up table with db_id in any of the system databases.]]></description>
		<content:encoded><![CDATA[<p>need to get by db table names , is there any sys table where it ties up table with db_id in any of the system databases.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amir Hussein Samiani</title>
		<link>http://blog.sqlauthority.com/2011/10/02/sql-server-ce-list-of-information_schema-system-tables/#comment-299886</link>
		<dc:creator><![CDATA[Amir Hussein Samiani]]></dc:creator>
		<pubDate>Mon, 11 Jun 2012 16:22:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14727#comment-299886</guid>
		<description><![CDATA[In your case, the positive point point is that you do not need such a complex code as Sql Server 2000 does not support Schemas at all.]]></description>
		<content:encoded><![CDATA[<p>In your case, the positive point point is that you do not need such a complex code as Sql Server 2000 does not support Schemas at all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2011/10/02/sql-server-ce-list-of-information_schema-system-tables/#comment-265227</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Tue, 20 Mar 2012 08:53:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14727#comment-265227</guid>
		<description><![CDATA[Note that SELECT * FROM INFORMATION_SCHEMA.INDEXES will work only in SQL CE version only]]></description>
		<content:encoded><![CDATA[<p>Note that SELECT * FROM INFORMATION_SCHEMA.INDEXES will work only in SQL CE version only</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SUBHASH</title>
		<link>http://blog.sqlauthority.com/2011/10/02/sql-server-ce-list-of-information_schema-system-tables/#comment-263675</link>
		<dc:creator><![CDATA[SUBHASH]]></dc:creator>
		<pubDate>Fri, 16 Mar 2012 10:23:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14727#comment-263675</guid>
		<description><![CDATA[SELECT * FROM INFORMATION_SCHEMA.INDEXES
DOESN&#039;T WORK IN SQL SERVER 2000]]></description>
		<content:encoded><![CDATA[<p>SELECT * FROM INFORMATION_SCHEMA.INDEXES<br />
DOESN&#8217;T WORK IN SQL SERVER 2000</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amir Hussein Samiani</title>
		<link>http://blog.sqlauthority.com/2011/10/02/sql-server-ce-list-of-information_schema-system-tables/#comment-256913</link>
		<dc:creator><![CDATA[Amir Hussein Samiani]]></dc:creator>
		<pubDate>Sun, 26 Feb 2012 10:29:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14727#comment-256913</guid>
		<description><![CDATA[--Drop and Recreate Foreign Key Constraints

    SET NOCOUNT ON

    DECLARE @table TABLE(
	   RowId INT PRIMARY KEY IDENTITY(1, 1),
	   ForeignKeyConstraintName NVARCHAR(200),
	   ForeignKeyConstraintTableSchema NVARCHAR(200),
	   ForeignKeyConstraintTableName NVARCHAR(200),
	   ForeignKeyConstraintColumnName NVARCHAR(200),
	   PrimaryKeyConstraintName NVARCHAR(200),
	   PrimaryKeyConstraintTableSchema NVARCHAR(200),
	   PrimaryKeyConstraintTableName NVARCHAR(200),
	   PrimaryKeyConstraintColumnName NVARCHAR(200)    
    )

    INSERT INTO @table(ForeignKeyConstraintName, ForeignKeyConstraintTableSchema, ForeignKeyConstraintTableName, ForeignKeyConstraintColumnName)
    SELECT 
	   U.CONSTRAINT_NAME, 
	   U.TABLE_SCHEMA, 
	   U.TABLE_NAME, 
	   U.COLUMN_NAME 
    FROM 
	   INFORMATION_SCHEMA.KEY_COLUMN_USAGE U
		  INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS C
			 ON U.CONSTRAINT_NAME = C.CONSTRAINT_NAME
    WHERE
	   C.CONSTRAINT_TYPE = &#039;FOREIGN KEY&#039;

    UPDATE @table SET
	   PrimaryKeyConstraintName = UNIQUE_CONSTRAINT_NAME
    FROM 
	   @table T
		  INNER JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS R
			 ON T.ForeignKeyConstraintName = R.CONSTRAINT_NAME

    UPDATE @table SET
	   PrimaryKeyConstraintTableSchema  = TABLE_SCHEMA,
	   PrimaryKeyConstraintTableName  = TABLE_NAME
    FROM @table T
	   INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS C
		  ON T.PrimaryKeyConstraintName = C.CONSTRAINT_NAME

    UPDATE @table SET
	   PrimaryKeyConstraintColumnName = COLUMN_NAME
    FROM @table T
	   INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE U
		  ON T.PrimaryKeyConstraintName = U.CONSTRAINT_NAME

    --SELECT * FROM @table

    --DROP CONSTRAINT:
    SELECT
	   &#039;
	   ALTER TABLE [&#039; + ForeignKeyConstraintTableSchema + &#039;].[&#039; + ForeignKeyConstraintTableName + &#039;] 
	   DROP CONSTRAINT &#039; + ForeignKeyConstraintName + &#039;
        
	   GO&#039;
    FROM
	   @table

    --ADD CONSTRAINT:
    SELECT
	   &#039;
	   ALTER TABLE [&#039; + ForeignKeyConstraintTableSchema + &#039;].[&#039; + ForeignKeyConstraintTableName + &#039;] 
	   ADD CONSTRAINT &#039; + ForeignKeyConstraintName + &#039; FOREIGN KEY(&#039; + ForeignKeyConstraintColumnName + &#039;) REFERENCES [&#039; + PrimaryKeyConstraintTableSchema + &#039;].[&#039; + PrimaryKeyConstraintTableName + &#039;](&#039; + PrimaryKeyConstraintColumnName + &#039;)
        
	   GO&#039;
    FROM
	   @table

    GO]]></description>
		<content:encoded><![CDATA[<p>&#8211;Drop and Recreate Foreign Key Constraints</p>
<p>    SET NOCOUNT ON</p>
<p>    DECLARE @table TABLE(<br />
	   RowId INT PRIMARY KEY IDENTITY(1, 1),<br />
	   ForeignKeyConstraintName NVARCHAR(200),<br />
	   ForeignKeyConstraintTableSchema NVARCHAR(200),<br />
	   ForeignKeyConstraintTableName NVARCHAR(200),<br />
	   ForeignKeyConstraintColumnName NVARCHAR(200),<br />
	   PrimaryKeyConstraintName NVARCHAR(200),<br />
	   PrimaryKeyConstraintTableSchema NVARCHAR(200),<br />
	   PrimaryKeyConstraintTableName NVARCHAR(200),<br />
	   PrimaryKeyConstraintColumnName NVARCHAR(200)<br />
    )</p>
<p>    INSERT INTO @table(ForeignKeyConstraintName, ForeignKeyConstraintTableSchema, ForeignKeyConstraintTableName, ForeignKeyConstraintColumnName)<br />
    SELECT<br />
	   U.CONSTRAINT_NAME,<br />
	   U.TABLE_SCHEMA,<br />
	   U.TABLE_NAME,<br />
	   U.COLUMN_NAME<br />
    FROM<br />
	   INFORMATION_SCHEMA.KEY_COLUMN_USAGE U<br />
		  INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS C<br />
			 ON U.CONSTRAINT_NAME = C.CONSTRAINT_NAME<br />
    WHERE<br />
	   C.CONSTRAINT_TYPE = &#8216;FOREIGN KEY&#8217;</p>
<p>    UPDATE @table SET<br />
	   PrimaryKeyConstraintName = UNIQUE_CONSTRAINT_NAME<br />
    FROM<br />
	   @table T<br />
		  INNER JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS R<br />
			 ON T.ForeignKeyConstraintName = R.CONSTRAINT_NAME</p>
<p>    UPDATE @table SET<br />
	   PrimaryKeyConstraintTableSchema  = TABLE_SCHEMA,<br />
	   PrimaryKeyConstraintTableName  = TABLE_NAME<br />
    FROM @table T<br />
	   INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS C<br />
		  ON T.PrimaryKeyConstraintName = C.CONSTRAINT_NAME</p>
<p>    UPDATE @table SET<br />
	   PrimaryKeyConstraintColumnName = COLUMN_NAME<br />
    FROM @table T<br />
	   INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE U<br />
		  ON T.PrimaryKeyConstraintName = U.CONSTRAINT_NAME</p>
<p>    &#8211;SELECT * FROM @table</p>
<p>    &#8211;DROP CONSTRAINT:<br />
    SELECT<br />
	   &#8216;<br />
	   ALTER TABLE [' + ForeignKeyConstraintTableSchema + '].[' + ForeignKeyConstraintTableName + ']<br />
	   DROP CONSTRAINT &#8216; + ForeignKeyConstraintName + &#8216;</p>
<p>	   GO&#8217;<br />
    FROM<br />
	   @table</p>
<p>    &#8211;ADD CONSTRAINT:<br />
    SELECT<br />
	   &#8216;<br />
	   ALTER TABLE [' + ForeignKeyConstraintTableSchema + '].[' + ForeignKeyConstraintTableName + ']<br />
	   ADD CONSTRAINT &#8216; + ForeignKeyConstraintName + &#8216; FOREIGN KEY(&#8216; + ForeignKeyConstraintColumnName + &#8216;) REFERENCES [' + PrimaryKeyConstraintTableSchema + '].[' + PrimaryKeyConstraintTableName + '](&#8216; + PrimaryKeyConstraintColumnName + &#8216;)</p>
<p>	   GO&#8217;<br />
    FROM<br />
	   @table</p>
<p>    GO</p>
]]></content:encoded>
	</item>
</channel>
</rss>
