Estimados:
Cree el siguiente SP:
Código:
USE [TFI]
GO
/****** Object: StoredProcedure [dbo].[Seg_UsuarioVerificarPassword] Script Date: 09/29/2011 21:39:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[Seg_UsuarioVerificarPassword]
-- Add the parameters for the stored procedure here
@nombreUsuario varchar(20),
@password varchar(20)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
Select *
From Seg_Usuario
Where [NombreUsuario] = @nombreUsuario and [Password] = @password
END
Cuando lo ejecuto con datos que matchean me da cero resultado.
Código:
USE [TFI]
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[Seg_UsuarioVerificarPassword]
@nombreUsuario like N'juan',
@password like N'20dd03088d8f13e7b04c80e10ab39f95'
SELECT 'Return Value' = @return_value
GO
sin embargo, cuando lo ejecuto así me devuelve el registro:
Código:
use tfi
select * from dbo.Seg_Usuario where [NombreUsuario]='juan'
and [Password]='20dd03088d8f13e7b04c80e10ab39f95'
Alguna idea?