nrc_douningbo的留言板

NRC_DouNingBo 2020-01-02 06:32:29
大家好,这里是我的留言板,如果有问题,欢迎大家留言,我会第一时间进行回复
...全文
34 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
SET QUOTED_IDENTIFIER ON GOSET ANSI_NULLS ON GOALTER proc sp_nrc_pattern_body /*this procedure is for the report ID:NRC002 Other procedure sp_uploadpicwithpath: upload the pictures to database */ ASdeclare @fname_in varchar(1000) ,@m_tbname varchar(50) --the name of the temporary table ,@sql varchar(8000) ,@fname varchar(1000) --catalogue and file name,the procedure need use ,@pattern_id_tmp intDECLARE @RC int , @rtncode int--get the size of the duct into filecreate table #pic (img image)create table #nrc_pattern_tmp ( nrc_pattern_id int, nrc_pattern_name nvarchar(30), nrc_pattern_desc nvarchar(60), nrc_pattern_path nvarchar(250), nrc_pattern_active_ind varchar(1), img image)insert into #nrc_pattern_tmp( nrc_pattern_id , nrc_pattern_name, nrc_pattern_desc, nrc_pattern_path, nrc_pattern_active_ind) select nrc_pattern_id , nrc_pattern_name, nrc_pattern_desc, nrc_pattern_path, nrc_pattern_active_ind from nrc_pattern where nrc_pattern_type=‘1‘ order by nrc_pattern_group_id,nrc_pattern_namedeclare cur_nrc_pattern cursor for select nrc_pattern_id,nrc_pattern_path from #nrc_pattern_tmp open cur_nrc_pattern fetch cur_nrc_pattern into @pattern_id_tmp, @fname while @@fetch_status = 0 begin --create the data process answer file set @m_tbname=‘[##temp‘+cast(newid() as varchar(40))+‘]‘ set @rtncode = 0 exec @rc = sp_uploadpicwithpath ‘#pic‘, @m_tbname, @fname,@rtncode output if @rtncode = 0 and @rc = ‘0 ‘ begin --duct the data into the formally table set @sql=‘update #nrc_pattern_tmp‘ +‘ set img=b.img‘ +‘ from #nrc_pattern_tmp a,‘ +@m_tbname +‘ b‘ +‘ where a.nrc_pattern_id =‘ + convert(char(4),@pattern_id_tmp) exec(@sql) --drop the temp table @m_tbname set @sql=‘drop table ‘+@m_tbname exec(@sql) end fetch cur_nrc_pattern into @pattern_id_tmp, @fname end close cur_nrc_pattern deallocate cur_nrc_pattern set @sql=‘select nrc_pattern_name , nrc_pattern_desc , nrc_pattern_active_ind, img from #nrc_pattern_tmp‘ exec(@sql) --set @sql=‘select nrc_pattern_path from NRC_PATTERN -- join p_test -- on nrc_pattern_path.pic=p_test.pic‘ -- exec(@sql) set @sql=‘drop table #pic‘ exec(@sql) set @sql=‘drop table #nrc_pattern_tmp‘ exec(@sql)GOSET QUOTED_IDENTIFIER OFF GOSET ANSI_NULLS ON GO

662

社区成员

发帖
与我相关
我的任务
社区描述
提出问题
其他 技术论坛(原bbs)
社区管理员
  • community_281
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧