存储过程变量问题, 直接用@cookie不行吗?干嘛又给个参数 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我是想根据通过传入的@id从表1中获取字段值然后insert到另张表里 楼主的这句有问题set @image =''select pro_image from heda_Products where pro_id=''+@id; 改成这样:set @image ='select pro_image from heda_Products where pro_id= ' + ''' + isnull(@id,'0') + ''' create proc aa(@cookie nvarchar(150) out,@id int )asdeclare @image nvarchar(150);set @image ='select pro_image from heda_Products where pro_id= ' + ''' + isnull(@id,'0') + ''' ;set @cookie=@image ;insert into heda_catbiao(biao_image) values(''+@cookie+'');return @cookie消息 102,级别 15,状态 1,过程 aa,第 9 行'0' 附近有语法错误。还是不行, 结果把字段都放进字段22 NULL NULL NULL select pro_image from heda_Products where pro_id= '+ @id + ' 1 CASE WHEN的用法 鱼老大我是你的fans,请进来指点一下 看似简单,却弄的我头疼了好久的sql。求高手指教 怎样才算一个良好的数据库 期待偶像们的帮忙 数据库问题,很多存储过程,我想知道哪几个存储过程用到了某个表 高手请进 有没有哪位仁兄基于oracle搞过空间数据挖掘方面的研究? SQL 开发中的一大困难,跪求帮助! 如何实现SQL SERVER中的表结构复制?(迫切需要高手指点...) 为何总是弹出“无法连接目标”的对话框? 存储过程有@id.根据传入@id从表1中获取内容,然后insert表2相关列 各位大大下午好,碰到一个SQL查询方面的问题,希望不吝赐教..
然后insert到另张表里
楼主的这句有问题set @image =''select pro_image from heda_Products where pro_id=''+@id;
set @image ='select pro_image from heda_Products where pro_id= ' + ''' + isnull(@id,'0') + '''
create proc aa
(
@cookie nvarchar(150) out,@id int
)
as
declare @image nvarchar(150);
set @image ='select pro_image from heda_Products where pro_id= ' + ''' + isnull(@id,'0') + ''' ;
set @cookie=@image ;insert into heda_catbiao(biao_image) values(''+@cookie+'');
return @cookie
消息 102,级别 15,状态 1,过程 aa,第 9 行
'0' 附近有语法错误。
还是不行,
结果把字段都放进字段
22 NULL NULL NULL select pro_image from heda_Products where pro_id= '+ @id + ' 1