C# T-SQL Stored Procedure Wrapper with dbscript

As my article on generating a C# wrapper for T-SQL Stored Procedures has recently become one of the most popular posts, I thought of providing an implementation within dbscript.

From the various different possibilities (generate from a Project Versions’ schema information, define an XSL on the Project Version’s XML) I chose the simplest solution was to create two Code Snippets.

The Code Snippet “Stored Procedure Wrapper (2000)” queries sysobjects, syscolumns and systypes, as outlined in the post.

The second Code Snippet, “Stored Procedure Wrapper”, queries the INFORMATION_SCHEMA views ROUTINES and PARAMETERS to achieve the same goal.

The generated C# code can be copied directly from the browser window into Visual Studio.

The Code Snippets can be downloaded here along with version 0.95 of dbscript, and will be included in future versions.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: