x
login about faq Site discussion (meta-askssc)

Can we call a stored function in the constraint of a table ?

I would like to know whether we can call a stored function in a constraint of a table ? Thank you

more ▼

asked Jan 11 '10 at 11:59 AM in Default

OraLearner gravatar image

OraLearner
1.3k 51 66 83

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

Yes. For example:

ALTER TABLE emp ADD CONSTRAINT caseCheckConstraint CHECK ( UPPER(ename)=ename )

Uses the UPPER function in a check constraint.

more ▼

answered Jan 11 '10 at 01:32 PM

Andrew Mobbs gravatar image

Andrew Mobbs
1.5k 1 3

(comments are locked)
10|1200 characters needed characters left

Unless it is an user-defined function.

more ▼

answered Jan 07 '11 at 03:49 PM

temp gravatar image

temp
1

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x359
x50
x18
x12

asked: Jan 11 '10 at 11:59 AM

Seen: 957 times

Last Updated: Jan 12 '10 at 12:36 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.