views:

60

answers:

1

I want to know how does the SQL Server know what @p# is in say this LINQtoSQL quey

   SELECT [t0].[MemberID], [t0].[Aspnetusername], [t0].[Aspnetpassword], [t0].[EmailAddr], [t0].[DateCreated], [t0].[Location], [t0].[DaimokuGoal], [t0].[PreviewImageID], [t0].[LastDaimoku] AS [LastDaimoku], [t0].[LastNotefied] AS [LastNotefied], [t0].[LastActivityDate] AS [LastActivityDate], [t0].[IsActivated]
    FROM [dbo].[Members] AS [t0]
    INNER JOIN [dbo].[MemberStats] AS [t1] ON [t0].[MemberID] = [t1].[MemberID]
    WHERE [t1].[TotalDeterminations] > @p0

When viewing SQLProfiler this is what gets executed against the database...but there is nothing telling SQL the value of @p0 so how does it know what that value is?

+2  A: 

It's a parameterized query generated by LINQ to SQL so that the query plan can be cached by SQL Server for later reuse. The parameter value was sent to SQL Server upon execution, it's just that the RPC:Completed event does not show it, if I recall correctly.