Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MyFunc(Retval) as default value for field?
Message
From
08/07/2005 06:01:55
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
MyFunc(Retval) as default value for field?
Miscellaneous
Thread ID:
01030304
Message ID:
01030304
Views:
58
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?
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Next
Reply
Map
View

Click here to load this message in the networking platform