0

I am using the NetTiers CodeSmith templates.

I am looking for a way to get the underlying column and table information from a view. CodeSmith's schema explorer is rather lacking in information about views.

Is there something I am missing in CodeSmith. Or is there a way I can get the underlying schema of the view itself so I can parse it and build my own meta data?

If CodeSmith is unable to provide any of this information. Then I could execute some custom sql to get the information, however I am unsure how to do that in CodeSmith as well.

Jereme
  • 630
  • 6
  • 18

1 Answers1

1

I work for CodeSmith... All the data that we get from the Informational_Schema is placed into the Extended Property bag. If you contact support I can send you the source to the SQLSchemaProvider and you can take a look at the exact queries we are running. If there is something that we are missing let us know.

Please remember you can execute any .NET code inside of a template including ado.net :).

Blake Niemyjski
  • 3,432
  • 3
  • 25
  • 41
  • As noted here: https://www.sqlservercurry.com/2010/09/display-view-definition-using-t-sql.html There are several ways to get additional information on views from sql. I prefer the second one: SELECT OBJECT_DEFINITION (OBJECT_ID(N'Purchasing.vVendor')) as [View Definition] It would be great if CodeSmith could expose more, but I will keep the ado.net option in mind and when I have time I will start to build my own parser to get more data for the views. – Jereme Sep 26 '18 at 20:10