请教CrazyFor (冬眠的鼹鼠):刚发现的一个小窍门,让Sql Profiler跟踪不到你的SQL语句。

DragonBill 2007-04-13 12:00:12
http://community.csdn.net/Expert/topic/5422/5422559.xml?temp=.6075556

兄弟,貌似不可以完全注释掉的


新开一个profiler,点events页面,把"store procedure"全选中看看,
还是可以看到滴~~~~~~~



...全文
263 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
scroing 2007-04-16
  • 打赏
  • 举报
回复
路过
DragonBill 2007-04-13
  • 打赏
  • 举报
回复
select newid() --password
确实是看不到

不过
execute store procudre --password
是可以trace到的..
呵呵
CrazyFor 2007-04-13
  • 打赏
  • 举报
回复
貌似选中楼主所说的也一样看不到,:)

sp4 --password

其它 用马可的: --sp_password

LiBin_OberthurCS 2007-04-13
  • 打赏
  • 举报
回复
路过
DragonBill 2007-04-13
  • 打赏
  • 举报
回复
不过我觉得这种偏门在研发时一点用都没有(没法Debug),除非在Release产品时才用得上:)
DragonBill 2007-04-13
  • 打赏
  • 举报
回复
呃,找到解决办法了:在procedure中每个SQL后面都加上 --sp_password或 --password
execute时再加上 --sp_password或 --password就可以了:D
DragonBill 2007-04-13
  • 打赏
  • 举报
回复
use pubs
go

create procedure testaaa
as
select top 10 * from authors
go

执行"execute testaaa"
sql profiler显示:

execute testaaa



执行"execute testaaa --sp_password"
sql profiler显示:

-- testaaa
select top 10 * from authors

我现在比较奇怪的是"select newid() --password"句为什么sql profiler不会显示出来
CrazyFor 2007-04-13
  • 打赏
  • 举报
回复
execute store procudre --sp_password

11,848

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 非技术版
社区管理员
  • 非技术版社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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