linq-to-sqlsql-server-ceinformation-schema

Need INFORMATION_SCHEMA MetaData


I'm trying to build a class in the tradition of Microsoft's LinqToSql code generator, only querying INFORMATION_SCHEMA instead. The problem I'm running into is that the metadata for INFORMATION_SCHEMA is undocumented for SQL CE. It's documented for SQL Server, but I'm not comfortable blindly doing a wholesale substitution.

http://technet.microsoft.com/en-us/library/ms174156.aspx

I've looked briefly at the code for MSLinqToSQLGenerator, but it's so complex I can't figure out where to even begin understanding how it does what it does.

How would one iterate through the columns of an INFORMATION_SCHEMA view, getting things like the data type, etc. for each column?


Solution

  • I found a tool that can do this. It's called SQL Offline, by Interscape:

    http://inters.com/

    It returns the data type for each of the INFORMATION_SCHEMA view columns.