error!向变量赋值的 SELECT 语句不能与数据检索操作结合使用 set @talCount = (select count(*) from tablea)if @talCount<@countbegin --error!向变量赋值的 SELECT 语句不能与数据检索操作结合使用 --请问什么原因end 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 error!向变量赋值的 SELECT 语句不能与数据检索操作结合使用把这个地方的语句贴上来看看 报的是if @talCount<@count这行出错了 declare @talCount bigintset @talCount = (select count(*) from sysobjects)print @talCount/*102*/ 我也试过能print出来,但是执行比较就出错 create table tb(a int)insert into tb select 1insert into tb select 2declare @i intselect @i=a,a from tb消息 141,级别 15,状态 1,第 6 行向变量赋值的 SELECT 语句不能与数据检索操作结合使用。 select @talCount=count(*) from tableaif @talCount<@countbegin --error!向变量赋值的 SELECT 语句不能与数据检索操作结合使用 --请问什么原因end 一道SQL面试题 大家帮忙看看 这句sql怎么写? 散分??? 数据库出问题了,高手来看一下 想问问在MS-SQL中存储过程中能不能放放入循环语句 100分求@@servername的问题? 如何检测库的容量大小?? 怎么样用sql,修改主键? 请给我一个应用程序操作SQL images的例子 求助!导入导出数据的问题: 请高手,二行变一行.在线等. 如何编写这条SQL语句
把这个地方的语句贴上来看看
这行出错了
set @talCount = (select count(*) from sysobjects)
print @talCount/*
102
*/
insert into tb select 1
insert into tb select 2declare @i int
select @i=a,a from tb消息 141,级别 15,状态 1,第 6 行
向变量赋值的 SELECT 语句不能与数据检索操作结合使用。
if @talCount<@count
begin
--error!向变量赋值的 SELECT 语句不能与数据检索操作结合使用
--请问什么原因
end