Re: Question about check contraints

From: Narayana Vyas Kondreddi (answer_me_at_hotmail.com)
Date: 06/03/04


Date: Thu, 3 Jun 2004 16:10:29 +0100

That is not something recognized by LIKE. In this case, it is just a pattern
that CHECK constraint is looking for.

-- 
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Pro" <nospam@nospam.net> wrote in message
news:%23EEZz9SSEHA.2408@tk2msftngp13.phx.gbl...
What is the meaning of \d{3}?
I search the online book but cannot locate the information.
"Narayana Vyas Kondreddi" <answer_me@hotmail.com> wrote in message
news:Oba5lHJSEHA.3528@TK2MSFTNGP09.phx.gbl...
> That CHECK constraint is validating the data that is being stored in the
> column colorId, to make sure it is entered in a specific format. For
> example, the following are the valid values for that column:
>
> '\d{3}|(A){3}'
> '\d{3}|(1){3}'
> '\d{3}|(Z){3}'
>
> You could SELECT the data out from that column and see what other values
are
> accepted.
>
> Look up LIKE in SQL Server Books Online for more iformation on pattern
> matching.
> -- 
> HTH,
> Vyas, MVP (SQL Server)
> http://vyaskn.tripod.com/
> Is .NET important for a database professional?
> http://vyaskn.tripod.com/poll.htm
>
>
> "Pro" <nospam@nospam.net> wrote in message
> news:OOJf1sISEHA.2000@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> I'm viewing the setting in a table and find an expression in check
> contraints.
>
> ([colorId] like '\d{3}|([A-Z0-3]){3}')
>
> May I know the meaning for this expression?
>
> Thx
> Charles
>
>
>


Relevant Pages

  • Re: so slow DDQ update statement...
    ... Vyas, MVP (SQL Server) ... SQL Server Articles and Code Samples @ http://vyaskn.tripod.com/ ... > Vyas, MVP ...
    (microsoft.public.sqlserver.dts)
  • Re: Stored procedure question
    ... Vyas, MVP (SQL Server) ... > where UserID = @UserID ... > Vyas, MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: delete a system sp
    ... Vyas, MVP (SQL Server) ... >> how to rename or delete a stored procedure .. ...
    (microsoft.public.sqlserver.security)
  • Re: Lost Permissions after Detach/Attach
    ... Vyas, MVP ... > Did you move those databases to a different machine/different domain? ... > Vyas, MVP (SQL Server) ...
    (microsoft.public.sqlserver.server)
  • Re: Table Design Advice
    ... I will be creating db in SQL server though. ... MaterialCost (Currency) ... CONSTRAINT pk_products PRIMARY KEY, ...
    (microsoft.public.sqlserver.setup)