<?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>Direct dependencies on a column...</title><link>http://blogs.msdn.com/sqltips/archive/2005/07/05/435882.aspx</link><description>Queries to get direct dependencies on the column.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Direct dependencies on a column...</title><link>http://blogs.msdn.com/sqltips/archive/2005/07/05/435882.aspx#461259</link><pubDate>Tue, 06 Sep 2005 08:50:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:461259</guid><dc:creator>jorgen pedersen</dc:creator><description>Hi. I like your article very much. I need to get the name of the default constraint and tried to use sys.defafault_comstraints but it is not recocniced on my server. Is it because I have the SQL2000 server and not the 2005?&lt;br&gt;Jorgen</description></item><item><title>re: Direct dependencies on a column...</title><link>http://blogs.msdn.com/sqltips/archive/2005/07/05/435882.aspx#461672</link><pubDate>Wed, 07 Sep 2005 02:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:461672</guid><dc:creator>brad chapman</dc:creator><description>Good stuff, but the constraint info was missing one key type that I have been trying to reveal from system tables. Defualts created (Create Default - sys.objects as D where parent_object_id = 0) are not stored in sys.default_constraints - this is fine except that drom which system table do I retrieve the default value? Example: create default load_date as getdate() load_date became a row in sys.objects, but I cannot find the system table where its default value is revealed.</description></item><item><title>re: Direct dependencies on a column...</title><link>http://blogs.msdn.com/sqltips/archive/2005/07/05/435882.aspx#461702</link><pubDate>Wed, 07 Sep 2005 04:00:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:461702</guid><dc:creator>SQL Server Engine Team</dc:creator><description>Yes, the catalog view is new to SQL Server 2005. You have to look in syscomments in older versions to get the defaults. Here is a sample query that shows defaults for all tables in a database:&lt;br&gt;&lt;br&gt;select OBJECT_NAME(c1.id) as table_name, c1.name as column_name, c2.text as default_text&lt;br&gt;  from syscolumns AS c1&lt;br&gt;  join syscomments AS c2&lt;br&gt;    on c1.cdefault = c2.id&lt;br&gt; where c1.cdefault is not null&lt;br&gt; order by table_name, column_name;&lt;br&gt;&lt;br&gt;--&lt;br&gt;Umachandar</description></item><item><title>re: Direct dependencies on a column...</title><link>http://blogs.msdn.com/sqltips/archive/2005/07/05/435882.aspx#461709</link><pubDate>Wed, 07 Sep 2005 04:24:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:461709</guid><dc:creator>SQL Server Engine Team</dc:creator><description>&amp;lt;DIV&amp;gt;** Removed comment due to formatting issues while editing it. Reposted below. **&amp;lt;/DIV&amp;gt;</description></item><item><title>re: Direct dependencies on a column...</title><link>http://blogs.msdn.com/sqltips/archive/2005/07/05/435882.aspx#461970</link><pubDate>Wed, 07 Sep 2005 18:46:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:461970</guid><dc:creator>Brad Chapman</dc:creator><description>Thanks for the info (sql_modules).  It was not clear what was provided for backward compatibility and what will be removed.  Are you saying Create Default will be removed in future versions.  This is a  great site - keep it up.</description></item><item><title>re: Direct dependencies on a column...</title><link>http://blogs.msdn.com/sqltips/archive/2005/07/05/435882.aspx#462046</link><pubDate>Wed, 07 Sep 2005 21:33:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:462046</guid><dc:creator>SQL Server Engine Team</dc:creator><description> Defaults created by using create default is not exposed in sys.default_constraints since it is not declarative i.e., these are not specified at the time of creation of the table/column. Note that the CREATE DEFAULT feature is provided for backward compatibility reasons and it will be removed in a future version. To find the link between defaults created by CREATE DEFAULT and the column bound via sp_bindefault, you can use the query:&lt;br&gt;&lt;br&gt;select s.name as schema_name, t.name as table_name, c.name as column_name, object_name(c.default_object_id) as bound_to_default&lt;br&gt;  from sys.columns as c&lt;br&gt;  join sys.tables as t&lt;br&gt;    on t.object_id = c.object_id&lt;br&gt;  join sys.schemas as s&lt;br&gt;    on s.schema_id = t.schema_id&lt;br&gt; where c.default_object_id is not null;&lt;br&gt;&lt;br&gt; To find the default text itself, you can use query below:&lt;br&gt;&lt;br&gt;select o.name as default_name, m.definition as default_text&lt;br&gt;  from sys.sql_modules as m&lt;br&gt;  join sys.objects as o&lt;br&gt;    on o.object_id = m.object_id&lt;br&gt; where o.type = 'D';&lt;br&gt;&lt;br&gt; Note that the text is the entire CREATE DEFAULT statement. The catalog view sys.sql_modules is analogous to syscomments.&lt;br&gt;&lt;br&gt;--&lt;br&gt;Umachandar</description></item><item><title>re: Direct dependencies on a column...</title><link>http://blogs.msdn.com/sqltips/archive/2005/07/05/435882.aspx#462049</link><pubDate>Wed, 07 Sep 2005 21:34:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:462049</guid><dc:creator>SQL Server Engine Team</dc:creator><description>I was referring to the CREATE DEFAULT statement. You can look at the CREATE DEFAULT topic in SQL Server 2005 Books Online for more details. The link for the topic is:&lt;br&gt;&lt;br&gt;ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/08475db4-7d90-486a-814c-01a99d783d41.htm</description></item><item><title>Determine primary keys and unique keys for all tables in a database...</title><link>http://blogs.msdn.com/sqltips/archive/2005/07/05/435882.aspx#469137</link><pubDate>Fri, 16 Sep 2005 21:32:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:469137</guid><dc:creator>SQL Server Engine Tips</dc:creator><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></item><item><title>For SQL Server 2000 - re: Direct dependencies on a column...</title><link>http://blogs.msdn.com/sqltips/archive/2005/07/05/435882.aspx#564043</link><pubDate>Wed, 29 Mar 2006 19:07:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:564043</guid><dc:creator>Ajas Mohammed</dc:creator><description>Hi,&lt;br&gt; &amp;nbsp; I was wondering if you have a script for SQL 2000. Ofcourse the one you have wouldnt work I believe bcause its for 2005. What I want is to find dependencies on a column in table in a database or different databases(broader sense).. dependencies like object, constraint etc..&lt;br&gt;&lt;br&gt;Thanks</description></item><item><title>re: Direct dependencies on a column...</title><link>http://blogs.msdn.com/sqltips/archive/2005/07/05/435882.aspx#920947</link><pubDate>Wed, 01 Nov 2006 14:19:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:920947</guid><dc:creator>Lou Gallo</dc:creator><description>&lt;p&gt;I was very interested in your post of Wednesday, September 07, 2005 where you described a way to retrieve the text of an sp. Is there a way to retrive the text of check constraints? &amp;nbsp;I'd like to generate ASP page code to perform validation on the client side. &amp;nbsp;I've been googling around and can't seem to find any way to do this. &amp;nbsp;Thanks&lt;/p&gt;</description></item><item><title>Table, Column, Replication Dependencies</title><link>http://blogs.msdn.com/sqltips/archive/2005/07/05/435882.aspx#8593227</link><pubDate>Thu, 12 Jun 2008 17:49:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8593227</guid><dc:creator>David Benoit</dc:creator><description>&lt;p&gt;Having been questioned about how to pull object / column dependencies through SQL I stumbled upon the&lt;/p&gt;
</description></item><item><title>Dropping a column with a default constraint &amp;laquo; Systems Engineering and RDBMS</title><link>http://blogs.msdn.com/sqltips/archive/2005/07/05/435882.aspx#9530610</link><pubDate>Fri, 03 Apr 2009 15:56:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9530610</guid><dc:creator>Dropping a column with a default constraint &amp;laquo; Systems Engineering and RDBMS</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://decipherinfosys.wordpress.com/2009/04/03/dropping-a-column-with-a-default-constraint/"&gt;http://decipherinfosys.wordpress.com/2009/04/03/dropping-a-column-with-a-default-constraint/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> SQL Server Engine Tips Direct dependencies on a column | debt settlement program</title><link>http://blogs.msdn.com/sqltips/archive/2005/07/05/435882.aspx#9754106</link><pubDate>Mon, 15 Jun 2009 20:24:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9754106</guid><dc:creator> SQL Server Engine Tips Direct dependencies on a column | debt settlement program</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://edebtsettlementprogram.info/story.php?id=24288"&gt;http://edebtsettlementprogram.info/story.php?id=24288&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>