ExamNotes.net  -  IT certification portal

ForumsCertResearchTop sitesNewslettersFree email
HomeRegister


Exams Notes
Practice exams
Exam games
Questions by email
Online training
Training videos
College degrees
Boot camps
Book store
Links directory
Tell a friend
For webmasters




General discussions > Public newsgroups > microsoft.public.sqlserver.server > check constraint creation

Show a Printable Version
Email This Page to Someone!
Receive updates to this thread



Author check constraint creation
chris
Guest




Registered: Not Yet
Location:
Country:
State:
Certifications:
Working on:

Total Posts: N/A
check constraint creation

I am trying to make a check constraint for a social security number:
alter table student
add constraint ssn_cons check(s_id like
"[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]")

but it keeps blowing up:

Server: Msg 1759, Level 16, State 1, Line 1
Invalid column '[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]' is
specified in a constraint or computed-column definition.
Server: Msg 1750, Level 16, State 1, Line 1
Could not create constraint. See previous errors.
--
Any ideas?
Thanks in advance.
Chris


Report this post to a moderator

Old Post 10-17-02 04:23 PM
Reply w/Quote Edit/Delete Message IP: Logged
Wayne Snyder
Guest




Registered: Not Yet
Location:
Country:
State:
Certifications:
Working on:

Total Posts: N/A
Re: check constraint creation

Simply use single quotes ' around the check constraint instead of double
quotes "


"chris" <chris@fin2000.com> wrote in message
news:eR9G9uedCHA.2504@tkmsftngp09...
> I am trying to make a check constraint for a social security number:
> alter table student
> add constraint ssn_cons check(s_id like
> "[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]")
>
> but it keeps blowing up:
>
> Server: Msg 1759, Level 16, State 1, Line 1
> Invalid column '[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]' is
> specified in a constraint or computed-column definition.
> Server: Msg 1750, Level 16, State 1, Line 1
> Could not create constraint. See previous errors.
> --
> Any ideas?
> Thanks in advance.
> Chris
>
>



Report this post to a moderator

Old Post 10-17-02 04:23 PM
Reply w/Quote Edit/Delete Message IP: Logged
All times are GMT.
Post new thread   Post reply


Forum Jump:
Rate This Thread:
Forum Rules:
Who Can Read The Forum? Any registered user or guest.
Who Can Post New Topics? Any registered user.
Who Can Post Replies? Any registered user.
Changes: Messages can be edited by their author.
Posts: HTML code is OFF. Smilies are ON. vB code is ON. [IMG] code is OFF.
 

ExamNotes forum archive


Powered by: vBulletin 2.2.8
Copyright ©2000, Jelsoft Enterprises Limited.

  Free Braindumps | mcse braindumps