it will not execute it throws sum error .can anyone give the solution for this problem?
-- ================================================
-- Template generated from Template Explorer using:
-- Create Trigger (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- See additional Create Trigger templates for more
-- examples of different Trigger statements.
--
-- This block of comments will not be included in
-- the definition of the function.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[OnlineApplication]
ON [dbo].[bonus]
AFTER UPDATE
AS
if(exists(select * from OnlineApplication where RefCode='Muthukrishnan1001')
select count(RefCode) from OnlineApplication where RefCode='Muthukrishnan1001'
end
if count='1'
begin
update bonus set Bonus=500
end
else
begin
update bonus set Bonus=100
end
error is
Msg 156, Level 15, State 1, Procedure OnlineApplication, Line 9
Incorrect syntax near the keyword 'select'.
Msg 156, Level 15, State 1, Procedure OnlineApplication, Line 12
Incorrect syntax near the keyword 'if'.