SLT
Je souhaite créer un trigger qui EXTRAIRE le 2 premieres lettre du nom
VOICI MESSAGE D erreur
Msg 137, Level 15, State 2, Procedure KeyAuto, Line 6
Must declare the scalar variable "@Nom_Cat".
[code]
Create table tcategorie
(
Num_Cat varchar (2) not null,
Nom_Cat varchar(50) not null,
primary key (Num_Cat)
);
[code]
[code]
CREATE TRIGGER KeyAuto ON Tcategorie FOR INSERT
AS
BEGIN
IF(Num_Cat IS NULL)
INSERT INTO tcategorie(num_cat,nom_cat)
VALUES('select SUBSTRING (nom_cat,1,2)from tcategorie',@Nom_Cat);
END;
[code]
Partager