This is my query, but I am getting an error. Please help how to do it
declare @spid varchar(20)
if exists ((select @spid = Sponsor_Id from UserTransaction) where User_id= 'RL0814')
insert into UserTransaction(Sponsor_Id, User_Id)
values (@spid,'RL4108')
The error is:
Incorrect syntax near '='