如何在SQL分析器中查看SQL查询? [英] How to see SQL query in SQL profiler?

查看:135
本文介绍了如何在SQL分析器中查看SQL查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我发出更新查询或另一个使用Entity Framework 4更改数据库中的数据的数据操作语言(DML)查询时,如何查看发送到SQL Server的查询?

When I issue an update query or another Data Manipulation Language (DML) query that changes the data in the database, using Entity Framework 4, how do I see the query sent to the SQL Server?

假设我做了一些例子:

someEntityObjectInstance.SomeProperty = newValue;
context.SaveChanges();

在这种情况下,没有ObjectQuery做一个ToTraceString()反对,所以我不能真的看看封面下发生了什么。我相信有一些Microsoft SQL Server工具,如分析器或可以帮助我查看查询的东西。

In this case, there's no ObjectQuery to do a ToTraceString() against, so I can't really see what's going on under the covers. I believe there's some Microsoft SQL Server tool like the profiler or something that will help me see the query.

另外,VS 2010 Ultimate中的一些Intellitrace也是一样的,我想想?

Also, some Intellitrace in VS 2010 Ultimate does the same thing, I think?

你能教我如何使用SQL 2005 Profiler,如果有这样的事情?

Can you please teach me how to use the SQL 2005 Profiler, if there's any such thing?

更新

我正在查看SQL Server 2005 Profiler中的跟踪,但是当我发出一个 context.DeleteObject ()调用,或者当我更新对象并调用 context.SaveChanges()时,在分析器中看不到UPDATE或DELETE查询。我只看到wierd SELECT查询。

I am looking at a trace in SQL Server 2005 Profiler now but when I issue a context.DeleteObject() call or when I update an object and call context.SaveChanges(), I do not see the UPDATE or DELETE queries in the profiler. I only see wierd SELECT queries.

推荐答案

你回答了,sql服务器工具称为profiler

you answered it, sql server tool called profiler

编辑:

http://msdn.microsoft.com/en-us/library/ms187929.aspx

这篇关于如何在SQL分析器中查看SQL查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆