How to see SQL query in SQL profiler?

前端 未结 2 1139
鱼传尺愫
鱼传尺愫 2021-01-18 02:01

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 t

相关标签:
2条回答
  • 2021-01-18 02:22

    you answered it, sql server tool called profiler

    edit:

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

    0 讨论(0)
  • 2021-01-18 02:38

    There are easier ways, if all you want is see the sql queries as they hit the DB.

    Here are two very light-weight Sql profilers that can do the job for various SqlServer flavors, including LocalDb - "worked on my machine (TM)"

    ExpressProfiler

    By far the easiest to use one (and also the most bare-bones-show-me-the-SQL-statements-kthxbye) is ExpressProfiler on CodePlex.

    Download tiny ZIP, wonder if you really got the whole file (you did), run EXE inside, BAM!

    enter image description here

    And the whole program is a single 126 KB EXE ! Now that's lightweight!

    AnjLab Sql Profiler

    The other one is the one from DataWizard, which used to be free (apparently prices now start at $5).

    Somebody managed to save a snapshot on GitHub (including xcopy-installable binaries) when it was open-source.

    The executable presents itself as "AnjLab Sql Profiler" and allows some filtering of the displayed events - but this strength is also its weakness, as there are sooo many event types that can be enabled/disabled. If everything is selected, the output is overwhelmingly verbose.

    A saner output can be obtain by only selecting specific events.

    enter image description here

    Here are the events I have selected in order to get the above output:

    enter image description here

    0 讨论(0)
提交回复
热议问题