简体   繁体   English

如何在 SQL Server Profiler 中识别数据库?

[英]How to identify database in SQL Server Profiler?

In the SQL Server Profiler, I've added a filter for:在 SQL 服务器分析器中,我添加了一个过滤器:

DatabaseName Like MyDatabase

I then log into the same server and run:然后我登录到同一台服务器并运行:

select * from MyDatabase

I don't see any entries in the Profiler.我在 Profiler 中看不到任何条目。 I remove the above filter and run the statement again.我删除了上述过滤器并再次运行该语句。 It shows up in the Profiler.它显示在 Profiler 中。

Any idea why it isn't working with the filter?知道为什么它不能与过滤器一起使用吗?

Also, is there a way to filter on three databases?另外,有没有办法过滤三个数据库? In other words, I want to see execution against three databases.换句话说,我希望看到针对三个数据库的执行情况。

On the Events Selection tab of the Trace Properties window, hit the "Column Filters..." button and click on DatabaseName. 在“跟踪属性”窗口的“事件选择”选项卡上,单击“列过滤器...”按钮,然后单击“数据库名称”。 From here you can filter to your database(s). 在这里,您可以过滤到数据库。 If you double click on the "Like" group after entering your first database name, it will add another blank spot to enter a new name. 如果在输入第一个数据库名称后双击“ Like”组,它将添加另一个空白点以输入新名称。

When you start a new trace, click the Event Selection tab and then click the "Show All Columns" checkbox.当您开始新的跟踪时,单击事件选择选项卡,然后单击“显示所有列”复选框。 Then, scroll the window until you see the column "Database Name", and check all of the checkboxes there.然后,滚动 window 直到看到“数据库名称”列,然后选中所有复选框。 跟踪属性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM