how to do an update sql query correctly

0

I am setting up a stored procedure to update some data in a table but when I update it executes correctly but does not write anything about the database

USE [qappdotnet]
GO
/****** Object:  StoredProcedure [dbo].[webhook]    Script Date: 10/23/2018 18:11:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[webhook]
 @Email varchar (500),
  @Saldo varchar(8),
  @Coins varchar(2000)
AS BEGIN SET NOCOUNT ON 

 Declare @Confirma varchar(500)
 SELECT DISTINCT @Confirma =  COUNT (*) from Usuarios where Email=@Email

if(@Confirma <> 1)

 begin

UPDATE qappdotnet.dbo.Usuarios
SET Saldo=@Saldo,Coins = @Coins
WHERE Email=@Email;

Select @Confirma as Respuesta
 end


 if(@Confirma = 1)
 begin
 Select @Confirma as Respuesta
 end


END
    
asked by emanuelle 24.10.2018 в 01:26
source

0 answers