Code Generation of Stored Procedures with examples

This is an article on code generation of stored procedures with examples.


Here is the main outline of the stored procedure generation template

<xsl:stylesheet version=”1.0″ xmlns:xsl=””&gt;
<xsl:output method=”text” standalone=”yes”>
<xsl:preserve-space elements=”row”>
<xsl:template match=”/”>





This is how to construct the insert body.

INSERT INTO <xsl:value-of select=”$name”> (<xsl:for-each select=”columns/row”>
<xsl:value-of select=”@COLUMN_NAME”>
<xsl:if test=”position() != last()”>, </xsl:if>
VALUES (<xsl:for-each select=”columns/row”>@<xsl:value-of select=”@COLUMN_NAME”>
<xsl:if test=”position() != last()”>, </xsl:if>


With this as a stub it will be easy to create the script. 

COM ProgIds in C#

This article describes how to add ProgIds to a C# App an expose it as a COM dll.

The key feture was this line.
[GuidAttribute("1F2A0E29-1934-4E2F-8E25-89467D68F3A9"), ProgId("Leszynski.InSpireAddin")]

 The article also includes registration details.