Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Assigning values to a column with a UDF
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Divers
Thread ID:
00886693
Message ID:
00886722
Vues:
20
The Inserted and Deleted are tables and only way to get info from a table (besides cursors) is a query.
Also, did you consider posibility that DhCreation column could be change by UPDATE in which case QuartID column wouldn't be updated?

>I got it:
>
>CREATE TRIGGER TR_TRANSACTION_INSERT ON [dbo].[Transaction]
>INSTEAD OF INSERT
>AS
>
>BEGIN
>
>Declare @Quart int, @DhCreation datetime
>
>SELECT @DhCreation = DhCreation FROM INSERTED
>SET @Quart = dbo.GetQuartID(@DhCreation)
>
>
>INSERT INTO [Transaction] (DhCreation, QuartID) values (@DhCreation,@Quart)
>
>END
>
>IT SEEMS that a SELECT is required and that the inserted by itself is not valid..
>
>
>Thanks.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform