I need help finish off a trigger for a table in my database. I want the trigger to update a table on condition that it meets two select queries. Take a look at the trigger below, where am i going wrong
Alter Trigger "ozekisms1_Trigger1"
as Declare @tel NVARCHAR(160)
Declare @send VARCHAR(30)
if exists (select sender from ozekisms1
on ozekisms1.sender=tblCustomer.mobilenum where tblCustomer.status='continue')
FROM tblTopic INNER JOIN
ozekisms1 ON tblTopic.Information = ozekisms1.msg
Select @send=sender FROM ozekisms1
Insert into ozekismsout(receiver,msg) values (@send,@tel)
The triggered table recieves a message from a user. First off I want to find out if they are registered with the system before I go any further, this is done by checking the username in triggered table with the table that contains the registered members.
The user sends a message as well and I want to check that this message corresponds with a hotword in another table. If it does I want to extract another column in that table. Following this I want to insert the users registered number and the corresponding column into the message out table.