Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 How can I view sql statements pass to the db?

Author  Topic 

jaywebguy
Starting Member

3 Posts

Posted - 2010-08-31 : 18:55:40
How can I view sql statements pass to the db from a point in time? I've tried good old google, but no luck so far?

I'm thinking I should be able to use sys.dm_exec_sql_text, but not sure how?

Thanks

Jason

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-09-01 : 05:36:55
Read about [/b]sys.dm_exec_query_stats dynamic management view[/b] in SQL Server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2010-09-01 : 07:11:52
Also -- you may have some luck (depending on what you are looking for) in the system reports

right click on a database (or the server) and go to reports ->

There are a ton of reports in there (they effectively use the system views the Madhivana mentioned).

They give statistics (don't know how reliable)


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

jaywebguy
Starting Member

3 Posts

Posted - 2010-09-01 : 12:26:04
Thanks,

I think I figured it out last night. Looks like your database has to be in the correct compatibility mode. I had moved this db from a sql 2000 server, which has a compatibility mode of 80. I changed the compatibility mode to 90 and was able to use the functions. Though it looks like by change the compatibility mode, I lost the ability to go back as far as I would have liked in the logs.

Jason
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-09-02 : 06:54:08
When you migrate you should test our application on the new SQL Server version - and with a specific compatibility.

My advice would be to change to the latest compatibility and make your tests. If anything is bust then fix it. If you cannot fix it (because the number of changes is huge, say, AND using an earlier Compatibility Mode fixes it THEN consider using the earlier compatibility mode.

Given that you have to make the test, to be sure your application is OK, it makes no sense to me to stick at an earlier compatibility mode (barring unfixable issues as above).

Beware that just changing compatibility mode may reveal compatibility issues in your application, so you should not change it without performing a full regression test.

Depends on the nature of your database, and the criticality of the data / application, of course

There are Hints and Tips on migrating to SQL 2008 - most of which also apply to migrating to SQL2005 - here:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=138230
Go to Top of Page
   

- Advertisement -