USE [Prueba_BD]
GO
/****** Object:  Table [dbo].[Usuarios]    Script Date: 11/03/2015 15:15:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Usuarios](
	[Id_Usuario] [int] IDENTITY(1,1) NOT NULL,
	[NombreUsuario] [varchar](15) NOT NULL,
	[Contraseña] [varchar](50) NOT NULL,
	[Estado] [nchar](1) NOT NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Usuarios] ON
INSERT [dbo].[Usuarios] ([Id_Usuario], [NombreUsuario], [Contraseña], [Estado]) VALUES (1, N'Oswaldo', N'123', N'1')
SET IDENTITY_INSERT [dbo].[Usuarios] OFF
/****** Object:  StoredProcedure [dbo].[S_ValidarUsuario]    Script Date: 11/03/2015 15:15:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Oswaldo Ríos Mozombite, orios@riossfotperu.com>
-- Create date: <31/10/2015>
-- Description:	<Ejemplo para el blog>
-- Blog:	<Ejemplo para el blog: http://vbnet-codigofuente.blogspot.pe/>
-- =============================================
CREATE PROCEDURE [dbo].[S_ValidarUsuario]
	-- Add the parameters for the stored procedure here
	@Usuario as 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 Id_Usuario, NombreUsuario, Contraseña, Estado from Usuarios where NombreUsuario=@Usuario and Estado='1'
END
GO
