455581763 2016-01-10 03:34 采纳率: 0%
浏览 1390
已结题

求指点写的存储过程哪里有问题?


/*1、执行存储过程未更新任何数据: 
execute dbo.pro_alarm_update_qr @s_zyh ='00024893' , @dt_jyrq ='2016-1-9 22:52:8.653' , @s_yq ='血球仪BF6800' , @s_ybh ='2601094769' , @s_xmbh ='13' , @dt_sendtime ='2016-1-9 22:52:8.653' , @s_czybh ='9999 管理员' , @dt_qrsj ='2016-1-10 10:29:8.616' */

--过程内容:
alter   PROCEDURE [dbo].[pro_alarm_update_qr]      
 @s_zyh     varChar(20), 
 @dt_jyrq    DateTime,  
 @s_yq      varchar(10), 
 @s_ybh     varchar(20), 
 @s_xmbh    varchar(20),
 @dt_sendtime datetime,
 @s_czybh   varchar(20),
 @dt_qrsj   datetime   
AS   
     update interface_lis_pacs..inter_lab_resultalert set hischeckman=@s_czybh,hischeckdt=@dt_qrsj
     where alertdt = @dt_jyrq and rptunitname=@s_yq and barcode=@s_ybh and rpt_itemid=@s_xmbh and alertdt = @dt_sendtime
go
-------------------------------------------------------------------------------
--2、把参数传进去,单独执行查询有数据,而且update也能够成功更新数据
     select * --  update a  set hischeckman=@s_czybh,hischeckdt=@dt_qrsj
     from interface_lis_pacs..inter_lab_resultalert a 
     where alertdt = '2016-1-9 22:52:8.653' and rptunitname='血球仪BF6800' and barcode='2601094769' and rpt_itemid='13' and alertdt = '2016-1-9 22:52:8.653' 
  • 写回答

3条回答 默认 最新

  • 太平牛市 2016-01-12 04:07
    关注

    楼主 你测试一下
    --2、把参数传进去,单独执行查询有数据,而且update也能够成功更新数据
    select * -- update a set hischeckman=@s_czybh,hischeckdt=@dt_qrsj
    from interface_lis_pacs..inter_lab_resultalert a
    where alertdt = '2016-1-9 22:52:8.653' and rptunitname='血球仪BF6800' and barcode='2601094769' and rpt_itemid='13' and alertdt = '2016-1-9 22:52:8.653'

        把这段后面的where条件删除,看看能不能查询出数据
        然后再把条件一个一个带入
    
    评论

报告相同问题?

悬赏问题

  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值