Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can MvcMiniProfiler display SQL parameter values?

I've been trying out MvcMiniProfiler as replacement for EFTracingProvider since it's so much simpler to configure.

It will display the sql just fine, but I'd like to see the parameter values as well.

insert [dbo].[PersonName]([Prefix], [GivenName], [MiddleName], [FamilyName], [Affix])
values (@0, @1, @2, @3, @4)
select [Id]
from [dbo].[PersonName]
where @@ROWCOUNT > 0 and [Id] = scope_identity()

Can MvcMiniProfiler display sql parameter values?

Here's my Global.asax. I'm using EF 4.3.1 with code-first.

protected void Application_Start()
{
    Bootstrapper.Initialize();

    AreaRegistration.RegisterAllAreas();

    RegisterGlobalFilters(GlobalFilters.Filters);
    RegisterRoutes(RouteTable.Routes);

    MiniProfilerEF.Initialize();
}

protected void Application_BeginRequest()
{
    if (Request.IsLocal)
    {
        MiniProfiler.Start(ProfileLevel.Verbose);
    }
}

protected void Application_EndRequest()
{
    MiniProfiler.Stop();
}
like image 571
jrummell Avatar asked Apr 03 '12 14:04

jrummell


1 Answers

If you want the SQL Server Formatter, try adding:

MiniProfiler.Settings.SqlFormatter = 
    new StackExchange.Profiling.SqlFormatters.SqlServerFormatter();

In Application_Start

like image 193
Sam Saffron Avatar answered Oct 14 '22 10:10

Sam Saffron