DECLARE @number int
declare @tempsql nvarchar(8000)
declare @where nvarchar(8000)select @tempsql=N'select @number=count(*) from product where productdwgcode = '+@code+' and ' +@whereexec sp_executesql @tempsql,N'@number int output',@number outputselect @number
declare @tempsql nvarchar(8000)
declare @where nvarchar(8000)select @tempsql=N'select @number=count(*) from product where productdwgcode = '+@code+' and ' +@whereexec sp_executesql @tempsql,N'@number int output',@number outputselect @number
解决方案 »
- 求一个SQL算法.内符SQL语句及要求
- 数据库加了恶意代码,需要全部替换掉,请前辈帮忙!!
- SQL SERVER 2000P配置服务器错误
- 请教跨库超做
- Sum 函数的执行出错,提示“Arithmetic overflow error converting expression to data type int.”,怎么解决?
- 执行SQL存储过程查询 得不到想要的结果
- SQL Sever基础问题,在线等待!
- 求救,分不够可以加,加多少都可以
- 对SQL高手来说,这是件非常容易的事
- 存储过程中.对数据进行修改.如果有输入项就修改,没有就保持原来的.应该怎么写?
- 怎样查询当前数据库的索引属性
- 关于数据表类型修改语句
这句的 @number +@code+@where
有没有赋值?不然的话,这个肯定是null了