Sql CE 分析器
我想知道是否有类似 Sql Profiler for Sql Server Compact Edition 的东西? 我使用 SqlCE 作为桌面应用程序的后端,如果能为这个嵌入式数据库提供像 sql profiler 这样的东西,那就太好了。 或者至少类似于 NHibernate show_sql 功能... 有任何想法吗? 谢谢 j。
i wonder if there is something similar to Sql Profiler for Sql Server Compact Edition?
i use SqlCE as backend for a desktop application and it would be really great to have something like sql profiler for this embedded database.
or at least something simliar to the NHibernate show_sql feature...
any ideas?
thanks
j.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我知道可以解决这个问题的唯一经过测试的解决方案是 Altiris Profiler 这是我在上一份工作中设计的工具,但它是闭源且非出售的。
挂接它的方法是为命令创建一个工厂,并在使用它们之前对其进行代理以进行分析(使用 RealProxy)。 它的重量非常轻,只需大约 10 行代码即可实现。
在 我的问题 Flory 谈到了一个名为 dynaTrace 的新工具,它也可能是也能够解决这个问题。
The only tested solution I know of that could solve this problem is Altiris Profiler which is a tool I designed at my previous job, but is closed source and not-for-sale.
The way you would hook it in, is by creating a factory for your commands and proxing them for profiling purposes before using them (using RealProxy). Its really light weight and about 10 lines of code to implement.
On my question Flory talks about a new tool called dynaTrace that may also be able to solve this problem as well.
我认为这行不通——CE 似乎是一个完全不同的野兽。
您可以启用一些可能对您有帮助的日志记录:
http:// /msdn.microsoft.com/en-us/library/ms171949(SQL.90).aspx
我尝试执行此操作并设法设置数据库并从 SSMS 连接 - 您必须指定备用连接类型“SQL Server 紧凑版”。 Profiler 没有这样的东西 - 并且为“数据库”字段输入数据文件的路径没有任何作用。
I don't think that would work - CE seems like a totally different beast.
You can enable some logging that might help you:
http://msdn.microsoft.com/en-us/library/ms171949(SQL.90).aspx
I tried to do this and managed to set the database up and connect from SSMS - you have to specify the alternate connection type of 'SQL Server Compact Edition'. Profiler has no such thing - and entering a path to the datafile for the 'database' field did nothing.
尝试安装标准版本(带有分析器),您也许还可以连接到 CE 实例。
Try to install a Standard version (with the profiler) and you might be able to connect to the CE instance also.
我认为可以使用默认探查器跟踪模板(来自 Visual Studio 2008)来完成。 我在博客中讨论了如何使用非 CE 版本 SQL 的模板:http://codingathome.blogspot.com/2009/04/create-sql-trace-and-read-it-using-sql.html 。
该模板可能适用于 SQL 的 CE 版本。 我没试过。 您的里程可能会有所不同。 我知道 SQL CE 不支持存储过程,所以这很可能不起作用。 您可能必须在代码中设置调试才能跟踪查询。
由于 CE 不支持存储过程,我打赌您仍然可以将脚本作为 .sql 脚本运行并安装跟踪事件。 值得一试。
I think that its possible that it could be done using the Default Profiler Trace Template (from Visual Studio 2008). I talk about using the template for a non-CE version of SQL in my weblog at: http://codingathome.blogspot.com/2009/04/create-sql-trace-and-read-it-using-sql.html .
Its possible that template would work for the CE version of SQL. I haven't tried it. Your milage might vary. I know that SQL CE doesn't support stored procedures so chances are this wont work. You might have to setup debugging in your code in order to trace queries.
Since CE doesn't support a stored procedure I bet you can still run the script as a .sql script and get the tracing events installed. Its worth a try.