Thanks Paul - I will explore that ... -----Original Message----- From: ProfoxTech [mailto:[email protected]] On Behalf Of Paul McNett Sent: 08 January 2013 16:09 To: [email protected] Subject: Re: [NF] Transact-SQL problem
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 [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] 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/[email protected] ** 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.

