判断数据是否存在,有返回值的存储过程

来源:互联网 发布:asp商城源码 编辑:程序博客网 时间:2024/05/21 08:01

USE [WX]
GO
/****** Object:  StoredProcedure [dbo].[Login]    Script Date: 08/05/2010 10:33:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- Batch submitted through debugger: SQLQuery11.sql|7|0|E:/Documents and Settings/wangbaoming.CN-MIC/Local Settings/Temp/~vs620F.sql
-- =============================================
-- Author:        <Author,,Name>
-- Create date: <Create Date,,>
-- Description:    <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[Login](
    -- Add the parameters for the stored procedure here
  @loginName nchar(20),
  @passWord  nchar(128),
  @empId     int out)
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 @empId= empId from table_user where loginName= @loginName and passWord= @passWord
    return @@rowcount
END

原创粉丝点击