The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.
This is my update command used on the front end Gridview that that is associated to a drop down that a user selects within the griview:
USE [Abc] GO /****** Object: Trigger [dbo].[EmailRule1] Script Date: 3/3/2014 4:18:49 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER TRIGGER [dbo].[EmailRule1] ON [dbo].[Demographics1] AFTER UPDATE AS -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; --Makes sure that the decision was changed IF NOT UPDATE(DDecision) RETURN IF EXISTS(SELECT * FROM inserted a join deleted b on a.RFSID=b.RFSID WHERE ((B.DDecision <> 'RuleA' OR B.DDecision <> 'RuleB') AND b.IsComplete = 0) AND ((A.DDecision='RuleA' or A.DDecision='RuleB') AND A.IsComplete = 0)) BEGIN DECLARE @newDEmail varchar(64) DECLARE @newDFirst varchar(64) DECLARE @newDLast varchar(64) DECLARE @EmailBody varchar(MAX) -- Insert statements for trigger here SELECT @newDEmail=a.DEmail, @newDFirst=a.DFirst,@newDLast=a.DLast from inserted a join deleted b on a.RFSID=b.RFSID WHERE (B.DDecision <> 'RuleA' OR B.DDecision <> 'RuleB') and (a.DDecision='RuleB' or a.DDecision='RuleA') SET @EmailBody = ' Dear '+ @newDFirst + ' '+ @newDLast + ', Email message ' EXEC msdb.dbo.sp_send_dbmail @profile_name ='Abc', @from_address = '"Abc" <email@example.com>', @reply_to = firstname.lastname@example.org', @copy_recipients = ‘email@example.com', @blind_copy_recipients = ‘firstname.lastname@example.org’, @recipients = @newDEmail, @subject = 'Abc Application Eligibility', @body =@EmailBody END
UpdateCommand="UPDATE [Demographics1] SET [DWID] = @DWID, [DFirst] = @DFirst, [DLast] = @DLast, [DSubmitDate] = @DSubmitDate, [DDecision] = @DDecision, [DIsActive] = @DIsActive, [IsComplete] = @IsComplete WHERE [RFSID] = @RFSID">
|Refresh Dev server with Production database||8||27|
|How to create a unique rule restriction on a table for two fields||16||76|
|T-SQL: New to using transactions||9||19|
|SQL - Use results of SELECT DISTINCT in a JOIN||4||13|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
14 Experts available now in Live!