How to see query history in SQL Server Management

2019-01-02 19:54发布

Is the query history stored in some log files? If yes, can you tell me how to find their location? If not, can you give me any advice on how to see it?

9条回答
与君花间醉酒
2楼-- · 2019-01-02 20:28

You can Monitor SQL queries by SQL Profiler if you need it

查看更多
听够珍惜
3楼-- · 2019-01-02 20:33

The system doesn't record queries in that way. If you know you want to do that ahead of time though, you can use SQL Profiler to record what is coming in and track queries during the time Profiler is running.

查看更多
梦该遗忘
4楼-- · 2019-01-02 20:34

you can use "Automatically generate script on every save", if you are using management studio. This is not certainly logging. Check if useful for you.. ;)

查看更多
登录 后发表回答