Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MyFunc(Retval) as default value for field?
Message
De
08/07/2005 06:35:30
Jon Neale
Bond International Software
Wootton Bassett, Royaume Uni
 
 
À
08/07/2005 06:01:55
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01030304
Message ID:
01030316
Vues:
21
Why cant you use a default constraint?

Have a look at this it shows you how to implement a default constraint that calls a UDF.

http://www.15seconds.com/issue/000817.htm

I know this doesnt answer your question but does it help?

>Basically I'd like to use a functions returnvalue as the default value for a field. That however does not work, so I figured a trigger might do the trick.
>
>But how do I tell the table that I only want to update the current record?
>
>
>-- I didn't expect this to work, and it sure doesn't
>
>ALTER  TRIGGER [MyTrigger] ON [dbo].[T1]
>FOR INSERT
>AS
>UPDATE T1 SET F2 =LTRIM(RTRIM(STR(F1))) WHERE CURRENT OF T1
>
>
>-- So how can I do a positioned update?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform