zoukankan      html  css  js  c++  java
  • sql server中存储过程提示错误

    1、今天写存储过程是运行时总是提示如下错误:

    Subquery returned more than 1 value. This is not permitted when the subquery follows =, t!=, <, <= ,>, >= or when he subquery is used as an expression.

    后来我一点点的查找终于知道是哪里的问题了,下面是错误的语句:

        select * from ResultTable where charIndex(','+convert(varchar(40),CenterID)+',',','+(SELECT OrgUnitIds FROM VolunteerSearch_Filter WHERE (UserId = 1) AND (SearchType = 'report') )+',')>0

     SELECT OrgUnitIds FROM VolunteerSearch_Filter WHERE (UserId = 1) AND (SearchType = 'report') 

    所获得的记录不是唯一的因此错了。

    2、存储过程运行提示错误:

    String or binary data would be truncated.

    Warning: Null value is eliminated by an aggregate or other SET operation.

    The statement has been terminated。

    解决方案:这是因为某字段的长度不够造成的。增大字段的长度就可以了。

  • 相关阅读:
    centos安装composer
    fmt.Printf()
    php进程,线程,异步
    php异步处理
    php安装swoole扩展
    冒泡排序
    快速排序
    php的foreach指针
    无密钥登陆
    ubuntu18.04切换阿里云源
  • 原文地址:https://www.cnblogs.com/lfzwenzhu/p/1331507.html
Copyright © 2011-2022 走看看