Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 SQL Trigger problem !

Author  Topic 

camelCasing
Starting Member

5 Posts

Posted - 2011-06-13 : 10:37:46
Hi everybody,

I want to copy my records to MS Sql( LKS GO - it is an ... program) from filemaker.

There is a relation between filemaker and Ms Sql with ODBC.

As a usually, i create and update records in sql table. I create records but i couldn't save some special table for Ms Sql(LKS Go program). There is an exception as like in attachment.



As you see , These tables have some triggers.(insert - update - delete ). I think i must run an insert Trigger. When i run sql query(insert trigger), there is also an exception.



Ms Sql ----> 2005

Can you help me please?
Thanks

camelCasing
Starting Member

5 Posts

Posted - 2011-06-14 : 03:56:52
Help me my friens ..
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-06-14 : 04:42:34
Post the code used in the trigger

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

camelCasing
Starting Member

5 Posts

Posted - 2011-06-14 : 05:03:17
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[LG_STFICHE_INS_207_05] ON [dbo].[LG_207_05_STFICHE]
FOR INSERT
AS
DECLARE @CLREF INT
DECLARE @TRCODE SMALLINT
DECLARE @NETTOTAL FLOAT
DECLARE @REPORTRATE FLOAT
DECLARE @BILLED SMALLINT
DECLARE @STATUS SMALLINT
DECLARE @CANCELLED SMALLINT
DECLARE @AFFECTCOLLTRL SMALLINT
DECLARE @AFFECTRISK SMALLINT
SELECT @CLREF = I.CLIENTREF,
@TRCODE = I.TRCODE,
@NETTOTAL = I.NETTOTAL,
@REPORTRATE = I.REPORTRATE,
@BILLED = I.BILLED,
@STATUS = I.STATUS,
@CANCELLED = I.CANCELLED,
@AFFECTCOLLTRL = I.AFFECTCOLLATRL,
@AFFECTRISK = I.AFFECTRISK FROM INSERTED I
IF (ISNULL(@AFFECTRISK,0)=0) AND (ISNULL(@CANCELLED,0)=0)
EXECUTE LG_UPDATECLCARDRISKNUMS_207_05 @CLREF, @TRCODE, @NETTOTAL, 1, @REPORTRATE, @BILLED, 0, @STATUS
IF (@AFFECTCOLLTRL=1) AND (ISNULL(@CANCELLED,0)=0)
EXECUTE LG_UPDCOLLATRLRISK_207_05 @CLREF, @TRCODE, @NETTOTAL, 1, @REPORTRATE, @BILLED, 0, @STATUS
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-06-14 : 05:54:45
Is LKS Go program a table name?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

camelCasing
Starting Member

5 Posts

Posted - 2011-06-14 : 06:00:49
No, it is an ERP Application(special programme)
Go to Top of Page

camelCasing
Starting Member

5 Posts

Posted - 2011-06-15 : 09:41:22
help me please
Go to Top of Page
   

- Advertisement -