• Jeff Moden (4/20/2014)


    Ok... I have to ask. What do either of those functions do for creating a table other than returning some meta-data that you could write some dynamic T-SQL to build a CREATE TABLE statement?

    From the top of my head:w00t:

    As a coding and s documentation aide, fastest method for optaining the metadata and structure (my favorite).

    For tracking / monitoring / auditing changes and asserting design compliance. Dump the results in a table...

    Optaining the metadata translation for SSIS packages, which i.e. create staging tables based on the metadata. Far better than writing a translation routine in the package.

    Adding a level of security to dynamic sql routines, similar to the INFORMATION_SCHEMA. An object or a column cannot be used in any way, shape or form unless it exists in the function's result set.

    BTW: The functions use an undocumented source definition (TABLE) within OPENROWSET, haven't looked further into that part:cool: