Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 9th, 2004, 02:55 PM
Authorized User
 
Join Date: Jul 2004
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default Rules/Constraints

I have a table that has many Y/N flags.
Is there any way to set up one rule for all of these, or do I need to put a separate constraint on each field?

I tried to create a UDT and bind it to a rule where @value in ('Y','N')
but it never fired.

if I can do it in one step, please tell me how.

TIA

 
Old July 11th, 2004, 01:50 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

CREATE RULE Flag_Rule
AS
@Flg IN ('y', 'n')

sp_bindrule Flag_Rule, 'table1.flg'


finally i am asking ....
why not using bit type for each column 0/1 ???

Ahmed Ali
Software Developer





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dropping constraints epp_b MySQL 2 September 12th, 2006 09:22 PM
How do you suspend constraints? Aaron Edwards SQL Server 2005 2 July 31st, 2006 12:16 PM
Tricks with Constraints ebsutherla SQL Server 2000 3 June 6th, 2004 05:28 AM
Adding constraints to the datasource Gibs_poovath ADO.NET 3 January 24th, 2004 03:43 AM
Failed to enable constraints ysu_computer_lab VS.NET 2002/2003 1 November 4th, 2003 11:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.