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)
 help with Trigger

Author  Topic 

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-10-02 : 10:02:20
Am trying to run a SP from an inserted value called successful, but it doesnt seem to run

What is wrong here ?
Am trying to run a SP Based on an inserted value called sucessful (columnn)

It doesnt update the field



ALTER TRIGGER [dbo].[T_Send_Execution]
ON [dbo].[Cnt_Billing_Transactions]
FOR UPDATE
AS
--Successful
declare @TransactionID int

select @TransactionID = (select successful from inserted)

exec [dbo].[SP_Execute_Send_TransactionID]@transactionid




USE [cellulant]
GO
/****** Object: StoredProcedure [dbo].[SP_Execute_Send TransactionID] Script Date: 10/02/2008 14:56:26 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[SP_Execute_Send_TransactionID] (
@return int )
AS

update Cnt_Billing_Transactions set smsstatus = @return where transactionID = @return

ashraff87
Starting Member

17 Posts

Posted - 2008-10-02 : 12:54:34
does your update update only one row by specifiying the full primary key?
if not, if the update is updating a number of rows there will be an issue here
select @TransactionID = (select successful from inserted)

I dont know if this is your problem, but ive noticed it might be one in the future.

Also dont call all your Stored Procs SP_...blah, it causes performance issues when they all being with sp_

As for the issue im sorry i cant see anythign, please explain the behaviour further, are those triggers and Sprocs being created or does it fail to even create them?
or do they just not work when you use them?
Go to Top of Page

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-10-02 : 13:55:26
TransactionID is the PK.

_____________________


Yes O !
Go to Top of Page
   

- Advertisement -