Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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.

Try to install a Standard version (with the profiler) and you might be able to connect to the CE instance also.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top