Hi every one , i wanted to build a positive edge with a variable that i named @Prozessstart. this is my programm
Create TRIGGER [dbo].[tinsert]
ON [dbo].[TBL_LiveData]
AFTER UPDATE
As
DECLARE @Prozessstart integer;
Prozessstart = 0
IF (SELECT dbo.TBL_LiveData.Value
FROM dbo.TBL_LiveData
WHERE dbo.TBL_LiveData.ConfigID = 251) =0
BEGIN
@Prozessstart := 0 ;
END
IF ((SELECT dbo.TBL_LiveData.Value
FROM dbo.TBL_LiveData
WHERE dbo.TBL_LiveData.ConfigID = 251) =1) AND @Prozessstart < 1
BEGIN
@Prozessstart <= @Prozessstart + 1
INSERT INTO ....
END
but i recieve this error message ,
Message 102, level 15, status 1, procedure tinsertV9, line 7 [Batchstart line 7].
Incorrect syntax near "@processstart".
Message 102, level 15, status 1, procedure tinsertV9, line 12 [Batchstart line 7].
Wrong syntax near "@processstart".
Message 102, level 15, status 1, procedure tinsertV9, line 18 [Batchstart line 7].
Wrong syntax near "@processstart".
Message 102, level 15, status 1, procedure tinsertV9, line 26 [Batchstart line 7].
Incorrect syntax near "END".
can anyone please help me ?