如果存在SQL StoreProcedure,如何返回1 true. [英] how to Return 1 true if exist SQL StoreProcedure.

查看:70
本文介绍了如果存在SQL StoreProcedure,如何返回1 true.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果存在SQL StoreProcedure,如何返回1 true.

how to Return 1 true if exist SQL StoreProcedure.

推荐答案

一种简化此方法的方法是:
One way to simplify this could be:
CREATE PROCEDURE Checkuser 
  @User varchar(34),
  @intOutput int OUTPUT
AS
BEGIN
   SET @intOutput = (SELECT COUNT(*) FROM aspnet_Users Where UserName = @User);
END
go


那应该返回表中匹配的用户数量.如果用户名是唯一的,则结果为0或1.


That should return the amount of users matching in the table. If the user name is unique, the result is 0 or 1.


这篇关于如果存在SQL StoreProcedure,如何返回1 true.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆