Home

LINQ to SQL Missing columns... ?

I have a query with sub queries etc that has 200 or so columns. It's (of course) much better for me to develop these queries using linq, but I want to take the SQL output to use in an SSIS job... (SSIS 2008).

When I click on the SQL view, it produces perfect SQL, but is only outputting 6 of the columns...

I see a theme. The 6 columns being output are all the 'queried columns' The missing columns are all like the below...

Plan_Type_Cd = "F",
Parent_Child_Flag = "null",
Currency_Cd = "USD",
State_Cd = "null",
Country_Cd = "USA",
Market_Value = "null",

Is there a trick to get these to auto generate into the SQL? It seems like a bug (minor).

Thanks,
-Kyle

(Awesome tool!)

Comments

  • What do you mean by the 'queried columns'? What does your LINQ query look like?
  • Here is a simple example:

    from u in UserProfiles
    select new
    {
    u.FirstName,
    MiddleName = "", //basic string
    u.LastName,
    Email = "email", //basic string
    }

    Now if I look at the generated SQL, it is:

    SELECT [t0].[FirstName], [t0].[LastName]
    FROM [UserProfile] AS [t0]

    The basic strings are not here. Instead I would expect to see paramater p0 = "" and paramater p1 = "email" and the query to include them, so that if I compare the LINQ query results, with the query results I get when I go run the generated SQL, ideally they should match.
Sign In or Register to comment.