<?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; Create Check Constraint on Column</title>
	<atom:link href="http://blog.sqlauthority.com/2008/06/22/sql-server-create-check-constraint-on-column/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2008/06/22/sql-server-create-check-constraint-on-column/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Thu, 09 Feb 2012 10:40:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: SQL SERVER – Interview Questions and Answers – Frequently Asked Questions – Day 9 of 31 Journey to SQLAuthority</title>
		<link>http://blog.sqlauthority.com/2008/06/22/sql-server-create-check-constraint-on-column/#comment-147031</link>
		<dc:creator><![CDATA[SQL SERVER – Interview Questions and Answers – Frequently Asked Questions – Day 9 of 31 Journey to SQLAuthority]]></dc:creator>
		<pubDate>Sat, 09 Jul 2011 01:31:43 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=656#comment-147031</guid>
		<description><![CDATA[[...] A CHECK constraint is used to limit the values that can be placed in a column. The check constraints are used to enforce domain integrity. (Read more here) [...]]]></description>
		<content:encoded><![CDATA[<p>[...] A CHECK constraint is used to limit the values that can be placed in a column. The check constraints are used to enforce domain integrity. (Read more here) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adarsh Mishra</title>
		<link>http://blog.sqlauthority.com/2008/06/22/sql-server-create-check-constraint-on-column/#comment-63854</link>
		<dc:creator><![CDATA[Adarsh Mishra]]></dc:creator>
		<pubDate>Sat, 27 Mar 2010 15:38:17 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=656#comment-63854</guid>
		<description><![CDATA[Is this possible to fix the start value of a column??

For example there is a column called BookingId (varchar)in a table, and it should start with the value HB100.

Please let me know if it can be done using any check constraint on the column..

Thanks]]></description>
		<content:encoded><![CDATA[<p>Is this possible to fix the start value of a column??</p>
<p>For example there is a column called BookingId (varchar)in a table, and it should start with the value HB100.</p>
<p>Please let me know if it can be done using any check constraint on the column..</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marko Parkkola</title>
		<link>http://blog.sqlauthority.com/2008/06/22/sql-server-create-check-constraint-on-column/#comment-61740</link>
		<dc:creator><![CDATA[Marko Parkkola]]></dc:creator>
		<pubDate>Thu, 25 Feb 2010 07:44:19 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=656#comment-61740</guid>
		<description><![CDATA[You can check this yourself:

-- Delete any old test table
IF NOT (SELECT OBJECT_ID(&#039;dbo.MyTestTable&#039;)) IS NULL DROP TABLE MyTestTable
GO
-- Create test table
CREATE TABLE dbo.MyTestTable(i INT)
GO
-- Insert row
INSERT INTO dbo.MyTestTable SELECT 1
GO
-- Following fails because MyTestTable already has a row
-- which doesn&#039;t satisfy the check
ALTER TABLE dbo.MyTestTable ADD CONSTRAINT MyTestTable_chk CHECK (i &gt; 1)
GO
-- Insert row
-- This succeeds because the check above wasn&#039;t
-- actually commited because of the error
INSERT INTO dbo.MyTestTable SELECT 1
GO
-- Following works because we are saying that
-- &quot;don&#039;t check old values&#039;
ALTER TABLE dbo.MyTestTable WITH NOCHECK ADD CONSTRAINT MyTestTable_chk CHECK (i &gt; 1)
GO
-- Try to insert row
-- This fails because of the check above
INSERT INTO dbo.MyTestTable SELECT 1
GO
-- Returns 2 rows
SELECT * FROM dbo.MyTestTable
GO
-- Drop test table
DROP dbo.MyTestTable
GO]]></description>
		<content:encoded><![CDATA[<p>You can check this yourself:</p>
<p>&#8211; Delete any old test table<br />
IF NOT (SELECT OBJECT_ID(&#8216;dbo.MyTestTable&#8217;)) IS NULL DROP TABLE MyTestTable<br />
GO<br />
&#8211; Create test table<br />
CREATE TABLE dbo.MyTestTable(i INT)<br />
GO<br />
&#8211; Insert row<br />
INSERT INTO dbo.MyTestTable SELECT 1<br />
GO<br />
&#8211; Following fails because MyTestTable already has a row<br />
&#8211; which doesn&#8217;t satisfy the check<br />
ALTER TABLE dbo.MyTestTable ADD CONSTRAINT MyTestTable_chk CHECK (i &gt; 1)<br />
GO<br />
&#8211; Insert row<br />
&#8211; This succeeds because the check above wasn&#8217;t<br />
&#8211; actually commited because of the error<br />
INSERT INTO dbo.MyTestTable SELECT 1<br />
GO<br />
&#8211; Following works because we are saying that<br />
&#8211; &#8220;don&#8217;t check old values&#8217;<br />
ALTER TABLE dbo.MyTestTable WITH NOCHECK ADD CONSTRAINT MyTestTable_chk CHECK (i &gt; 1)<br />
GO<br />
&#8211; Try to insert row<br />
&#8211; This fails because of the check above<br />
INSERT INTO dbo.MyTestTable SELECT 1<br />
GO<br />
&#8211; Returns 2 rows<br />
SELECT * FROM dbo.MyTestTable<br />
GO<br />
&#8211; Drop test table<br />
DROP dbo.MyTestTable<br />
GO</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CN Shekhar</title>
		<link>http://blog.sqlauthority.com/2008/06/22/sql-server-create-check-constraint-on-column/#comment-61728</link>
		<dc:creator><![CDATA[CN Shekhar]]></dc:creator>
		<pubDate>Thu, 25 Feb 2010 04:02:09 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=656#comment-61728</guid>
		<description><![CDATA[What will happen If add a check constraint on a prefilled table i.e table whihc already has data.
Will it allow me to create the check constraint.]]></description>
		<content:encoded><![CDATA[<p>What will happen If add a check constraint on a prefilled table i.e table whihc already has data.<br />
Will it allow me to create the check constraint.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://blog.sqlauthority.com/2008/06/22/sql-server-create-check-constraint-on-column/#comment-58012</link>
		<dc:creator><![CDATA[Brian Tkatch]]></dc:creator>
		<pubDate>Mon, 30 Nov 2009 14:43:07 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=656#comment-58012</guid>
		<description><![CDATA[@Nir

If there is a FK to the jobs TABLE, add the salary basis column to the FK, then you have it locally and a normal CHECK CONSTRAINT could be used.

Another options would be instead of salary to have salarybasis_modifier, which means that the salary is always at least the salarybasis but it can also be added to in this COLUMN.]]></description>
		<content:encoded><![CDATA[<p>@Nir</p>
<p>If there is a FK to the jobs TABLE, add the salary basis column to the FK, then you have it locally and a normal CHECK CONSTRAINT could be used.</p>
<p>Another options would be instead of salary to have salarybasis_modifier, which means that the salary is always at least the salarybasis but it can also be added to in this COLUMN.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nir</title>
		<link>http://blog.sqlauthority.com/2008/06/22/sql-server-create-check-constraint-on-column/#comment-57926</link>
		<dc:creator><![CDATA[Nir]]></dc:creator>
		<pubDate>Thu, 26 Nov 2009 05:58:10 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=656#comment-57926</guid>
		<description><![CDATA[i forgot something
it&#039;s important to do that without using triggers
with triggers it&#039;s not hard]]></description>
		<content:encoded><![CDATA[<p>i forgot something<br />
it&#8217;s important to do that without using triggers<br />
with triggers it&#8217;s not hard</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nir</title>
		<link>http://blog.sqlauthority.com/2008/06/22/sql-server-create-check-constraint-on-column/#comment-57925</link>
		<dc:creator><![CDATA[Nir]]></dc:creator>
		<pubDate>Thu, 26 Nov 2009 05:54:06 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=656#comment-57925</guid>
		<description><![CDATA[i have one column on table1,
how can i add constraint to that column, 
depending on a column on another table

i have &#039;salary&#039; for a worker on workers table, 
and i want it to be more than &#039;salarybasis&#039; on jobs table

thanks]]></description>
		<content:encoded><![CDATA[<p>i have one column on table1,<br />
how can i add constraint to that column,<br />
depending on a column on another table</p>
<p>i have &#8216;salary&#8217; for a worker on workers table,<br />
and i want it to be more than &#8216;salarybasis&#8217; on jobs table</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://blog.sqlauthority.com/2008/06/22/sql-server-create-check-constraint-on-column/#comment-57464</link>
		<dc:creator><![CDATA[Rich]]></dc:creator>
		<pubDate>Mon, 09 Nov 2009 20:22:02 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=656#comment-57464</guid>
		<description><![CDATA[ponnusamy, you can add multiple constraints on the column. Add a constraint for each value.]]></description>
		<content:encoded><![CDATA[<p>ponnusamy, you can add multiple constraints on the column. Add a constraint for each value.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ponnusamy</title>
		<link>http://blog.sqlauthority.com/2008/06/22/sql-server-create-check-constraint-on-column/#comment-55831</link>
		<dc:creator><![CDATA[ponnusamy]]></dc:creator>
		<pubDate>Sat, 12 Sep 2009 08:59:30 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=656#comment-55831</guid>
		<description><![CDATA[how to add more than one value as a check constraint for column?

thanks in advance]]></description>
		<content:encoded><![CDATA[<p>how to add more than one value as a check constraint for column?</p>
<p>thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nisheeth</title>
		<link>http://blog.sqlauthority.com/2008/06/22/sql-server-create-check-constraint-on-column/#comment-45231</link>
		<dc:creator><![CDATA[Nisheeth]]></dc:creator>
		<pubDate>Wed, 31 Dec 2008 12:23:28 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=656#comment-45231</guid>
		<description><![CDATA[thanx man.]]></description>
		<content:encoded><![CDATA[<p>thanx man.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER - 2008 - Interview Questions and Answers - Part 4 Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2008/06/22/sql-server-create-check-constraint-on-column/#comment-43046</link>
		<dc:creator><![CDATA[SQL SERVER - 2008 - Interview Questions and Answers - Part 4 Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Sat, 20 Sep 2008 07:05:27 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=656#comment-43046</guid>
		<description><![CDATA[[...] A CHECK constraint is used to limit the values that can be placed in a column. The check constraints are used to enforce domain integrity. (Read More Here) [...]]]></description>
		<content:encoded><![CDATA[<p>[...] A CHECK constraint is used to limit the values that can be placed in a column. The check constraints are used to enforce domain integrity. (Read More Here) [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

