On 1/8/13 8:02 AM, Paul Newton wrote:
> Hi all
> 
> The following is a column definition (part of a create table statement in 
> Transact-SQL
> 
>                 [wp_pssslip]      [int] NOT NULL CONSTRAINT 
> [DF_wparm_wp_pssslip] DEFAULT (24)
> 
> I want the default value for this field to be the lesser of 24 and the value 
> of another field (wp_summpp)
> 
> I have no idea if this is possible or how I would go about it so any 
> suggestions would be highly appreciated
> 
> The only clue I have from the help is this:
> 
> "Only a constant value, such as a character string; a scalar function (either 
> a system, user-defined, or CLR function); or NULL can be used as a default."

You'll want to do this inside an AFTER INSERT trigger.

Paul



_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/50ec4483.2010...@ulmcnett.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to