x

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 69 85 88

(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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

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

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x375
x50
x21
x16

asked: Jan 11 '10 at 11:59 AM

Seen: 1496 times

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