Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 2012 将varchar值“”转换为int数据类型时,转换失败_Sql Server 2012 - Fatal编程技术网

Sql server 2012 将varchar值“”转换为int数据类型时,转换失败

Sql server 2012 将varchar值“”转换为int数据类型时,转换失败,sql-server-2012,Sql Server 2012,我在下面有一个查询,其中没有out count函数。我得到了答案,如果使用count函数,我得到了这个错误-->将varchar值“转换为int数据类型时,转换失败 请严厉批评我 select 'INSERT INTO CM_ONTHEFLYCOMMUNICATION (c_source,c_classification,c_name,c_email,c_mobile,c_bookscount) values ( '''+'Library'+''','''+isnull('Che

我在下面有一个查询,其中没有out count函数。我得到了答案,如果使用count函数,我得到了这个错误-->将varchar值“转换为int数据类型时,转换失败

请严厉批评我

 select 'INSERT INTO CM_ONTHEFLYCOMMUNICATION (c_source,c_classification,c_name,c_email,c_mobile,c_bookscount) 
      values ( '''+'Library'+''','''+isnull('CheckOut -'+cio_branchname,'')+''',
      '''+ISNULL(cio_membername,'')+''','''+ISNULL(mstmember.m_email1,'')+''',
      '''+ISNULL(mstmember.m_mobile,'')+''','''+count(trncheckinout.cio_bookname)+''')' 

     AS MAILQRY
     from 
    trncheckinout inner join
    mstmember on cio_mrecid=m_recid where CIO_CheckOutDt = 20141208
    group by m_email1,m_mobile, cio_branchname,cio_membername
你试过康卡特吗

select CONCAT('INSERT INTO CM_ONTHEFLYCOMMUNICATION (c_source,c_classification,c_name,c_email,c_mobile,c_bookscount) 
  values ( '''+'Library'+''','''+isnull('CheckOut -'+cio_branchname,'')+''',
  '''+ISNULL(cio_membername,'')+''','''+ISNULL(mstmember.m_email1,'')+''',
  '''+ISNULL(mstmember.m_mobile,'')+''','''+count(trncheckinout.cio_bookname)+''')')
AS MAILQRY
 from 
trncheckinout inner join
mstmember on cio_mrecid=m_recid where CIO_CheckOutDt = 20141208
group by m_email1,m_mobile, cio_branchname,cio_membername