Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

<%@ Assembly Name="SchemaExplorer" %>
<%@ Import Namespace="SchemaExplorer" %>

When the user selects a table with SchemaExplorer, the TableSchema object will be populated and returned to CodeSmith. For the most part, this particular template can be filled out just by retrieving the names of the table, the table's owner, and the database from this object. All of those are easily available by navigating around the SchemaExplorer object model:

<%= SourceTable.Name %>
<%= SourceTable.Owner %>
<%= SourceTable.Database.Name %>

Substituting those expressions in appropriate places will get you most of the way through writing this particular template. But there's still one task left that requires a bit of coding: building the list of column names for the stored procedure.

Next: Writing the Database Code