我在sqlserver中建立存储过程,想在asp.net中输入一个值给存储过程,然后,我如何再sqlserver中看到这个值,我用了print,可是不知道print到哪里去了!log里面找不着啊。具体如下
CREATE procedure bugadd
(
@BugDate[datetime]='',
@bugtime[varchar](30)='',
@note[nvarchar](500)='',
@processnote[nvarchar](500)='',
@operatorNo[char](10)='',
@ComponentNo[char](10)='',
@bugState[char](10)='',
@belongtodevice[char](10)=''
)
as
insert into [devicemanagement].[dbo].[bugrecord]
([BugDate],
[bugtime],
[note],
[processnote],
[ComponentNo],
[bugState],
[operatorNo],
[belongtodevice]
)
values
(
@BugDate,
cast(@bugtime as datetime),
@note,
@processnote,
@ComponentNo,
@bugState,
@operatorNo,
@belongtodevice)
print @bugtime//就是要察看这个值,怎么才能看到阿?????????????
GO
CREATE procedure bugadd
(
@BugDate[datetime]='',
@bugtime[varchar](30)='',
@note[nvarchar](500)='',
@processnote[nvarchar](500)='',
@operatorNo[char](10)='',
@ComponentNo[char](10)='',
@bugState[char](10)='',
@belongtodevice[char](10)=''
)
as
insert into [devicemanagement].[dbo].[bugrecord]
([BugDate],
[bugtime],
[note],
[processnote],
[ComponentNo],
[bugState],
[operatorNo],
[belongtodevice]
)
values
(
@BugDate,
cast(@bugtime as datetime),
@note,
@processnote,
@ComponentNo,
@bugState,
@operatorNo,
@belongtodevice)
print @bugtime//就是要察看这个值,怎么才能看到阿?????????????
GO
解决方案 »
- aspx+mysql系统
- 如何绑定XML文件到TreeView
- 这两种事件的顺序 同时讨论一下b/s的无状态性
- 想作一聊天室网站,怎么存储聊天记录比较好,有例子最好,谢谢
- 文本框可以粘贴图片吗?
- 怎样把flash放到图片上
- .net 导出有图片的execl
- 郁闷中,在索引服务中添加一个编目,然后对一个文件夹进行索引,对txt文件都能很准确地检索出来,对htm何html文件确没有准确地检索出结果
- 下面是我的代码,请问怎么样在字段名userId2为空的时候让第二个TemplateColumn不显示
- 老调重谈,关于button 的出现确定窗口javascript疑问.
- 求助:同一个局域其网里的他机器不能访问我机器上的web service,而我在自己机器上访问却没有问题,why???
- .net 程序编译问题,请大家指教
可以在SQL 查询分析器里执行的时候看到。但是该存储过程或SQL语句是要在查询分析器里执行时才看的到,而不是程序调用。如果LZ就上面的存储过程想查看某个值,可以用3种方式:
1.在存储过程里设定一个输出参数,将你要看的值输出。
2.将要看的值作为存储过程return返回
3.将print @bugtime改为Select @bugtime as bugtime,然后程序执行这个存储过程返回的记录就是
你可以为存储过程添加一个参数@msg varchar(100) output;
然后在要输出的位置
set @msg = @bugtime
return;
当然在你的调用存储过程的地方需要做一个获取@msg返回值,并显示的处理了。