我在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
解决方案 »
- 求教高手:登陆后跳回之前页面的问题????
- 有关excel导入数据库的问题
- vs2005 里怎么没有Datagrid 这个控件呀?
- 请问哪儿有visual studio.net 2005正式版下载
- 关于dropdownlist问题
- ASP.NET购物车用什么存物品
- 怎么可以删除数据表中现在时间和一个字段时间差大于20分钟的所有所有数据呢
- 页面间传递变量时如何让地址栏中的name='xxx'屏蔽掉或变成乱码?
- 请高手指教ASP.NET的Encoding和Decoding问题
- 我自定义服务器控件是个Table内有其他各子控件,服务器控件有个Visiable属性即对Table进行Visiable,可我要在服务器控件的Onload中加入一
- 求助:同一个局域其网里的他机器不能访问我机器上的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返回值,并显示的处理了。