Click here to Skip to main content
15,885,546 members
Articles / Database Development / SQL Server

SQL XML Documentation

Rate me:
Please Sign up or sign in to vote.
4.59/5 (12 votes)
29 Feb 2008CPOL5 min read 112.4K   1.4K   75  
How to create and compile SQL XML Documentation comments
Usage:

    DatabaseToXml [-f <SqlScript> | -d <DataBaseName>]
      [-t | -s <ServerName> -u <UserName> -p <Password>]
      [-c <CsFile>] [-g <SqlScript>] [-r <Pattern>]

    Source:
      -f <SqlScript>    Import from SQL Script through TempDatabase.
      -d <DataBaseName> Database name.

    Connection:
      -t                Use trusted connection.
      -s <ServerName>   SQL server name. Default: localhost
      -u <UserName>     Database username.
      -p <Password>     SQL password.

    Filter:
      -r <Pattern>      Filter procedures with regular expression pattern.

    Destination:
      -g <SqlScript>    Specifies SQL Script output file to generate.
      -gd <Directory>   Specifies SQL multi-Script output directory.
      -c <CsFile>       Specifies C# code output file.

Examples:

    :: Export from Database.
    DatabaseToXml -d MyDatabase -t -c MyDatabase.cs

    :: Script SQL Stored procedures with parsed XML Comments.
    DatabaseToXml -d MyDatabase -t -g MyProcedures.sql

    :: Export XML from SQL Script file.
    :: Use trusted connection for 'TempDatabase'.
    DatabaseToXml -f MyScripts.sql -t -c MyDatabase.cs

    :: Export XML and exclude procedures with 'Globalization' inside name.
    DatabaseToXml -d MyDatabase -t -c MyDatabase.cs -r "^((?!Globalization).)*$"

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions