|
MS SQL Triggers question from a beginner |
Iniciado por Antonio Díaz, 26,feb. 2024 22:29 - 1 respuesta |
| |
| | | |
|
| |
Miembro registrado 71 mensajes |
|
Publicado el 26,febrero 2024 - 22:29 |
Hi guys,
For those of you who know Clarion, I come from many years of using it. I've used Triggers (on the server side) all the time but I have problems with WINDEV. I always get an error (huge content error) saying that too many rows are affected by the update.
The thing is I always get that error when the db tries to run a trigger to update certaing tables. The same trigger that runs using my clarion app, does not run using my windev app. Is there something I should take into account? I've looked for information but haven't found anything.
I thank you for your help.
--
Antonio Diaz Emphasys Software, S.C. |
| |
| |
| | | |
|
| | |
| |
Publicado el 14,octubre 2024 - 00:41 |
Antonio Díaz wrote:
Hi guys,
For those of you who know Clarion, I come from many years of using it. I've used Triggers (on the server side) all the time but I have problems with WINDEV. I always get an error (huge content error) saying that too many rows are affected by the update.
The thing is I always get that error when the db tries to run a trigger to update certaing tables. The same trigger that runs using my clarion app, does not run using my windev app. Is there something I should take into account? I've looked for information but haven't found anything.
I thank you for your help.
--
Antonio Diaz Emphasys Software, S.C.
Hi antonio i have been using windev with Sqlserver since version 20 with few problems
see below the way i use triggers in MSsql server
USE [Teste] GO /****** Object: Trigger [dbo].[LogLocal] Script Date: 10/13/2024 19:37:30 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO
ALTER TRIGGER [dbo].[LogLocal] ON [dbo].[local] FOR UPDATE ,DELETE
AS Declare @USERDEC char(10), @USERNT CHAR(30) SELECT @USERDEC = convert(varchar(10),context_info), @USERNT = SUBSTRING(host_name + '\' + login_name, 1,40) FROM sys.dm_exec_sessions WHERE session_id = @@SPID
Insert Log.dbo.LogLocal
Select 'U', Getdate() , @USERDEC , @USERNT, d.* from Deleted as D inner join inserted as I on I.Loc_codigo = D.Loc_codigo
UNION ALL Select 'D', Getdate(), @USERDEC , @USERNT, d.* from Deleted as D left join inserted as I on I.Loc_codigo = D.Loc_codigo where I.Loc_codigo is NULL |
| |
| |
| | | |
|
| | | | |
| | |
|