You are here: Re: Inserting nulls in to table conflicting with rule « MsSQL Server « IT news, forums, messages
Re: Inserting nulls in to table conflicting with rule

Posted by Michael Austin on 01/16/07 00:15

markjerz@googlemail.com wrote:

> Hi,
>
> I basically have two tables with the same structure. One is an archive
> of the other (backup). I want to essentially insert the data in to the
> other.
>
> I use:
>
> INSERT INTO table ( column, column .... )
> SELECT * FROM table2
>
> Now, table2 has a rule on various columns:
>
> @CHARACTER IN ('Y','N')
>
> but the column allows nulls, in the design view is says so anyway.
>
> When I run this query I get:
>
> A column insert or update conflicts with a rule imposed by a previous
> CREATE RULE statement. The statement was terminated. The conflict
> occurred in database 'database', table 'table', column 'column'.
> The statement has been terminated.
>
> Obviously, I've changed the names of everything.
>
> The only data in those columns which could possibly conflict with the
> rule is the NULL value. Any ideas why this doesn't work?
>
> Thanks.
>

my guess is by using the rule (IN ('Y','N')) - and that because you have said
ONLY Y,N values are allowed. It is essentially a check constraint in other
databases. And I would consider any other behavior a bug.

--
Michael Austin
Database Consultant
Domain Registration and Linux/Windows Web Hosting Reseller
http://www.spacelots.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация