Contents tagged with database

  • Simple SQL Server Database Schema Printer (ASP.NET)

    I created this simple app recently to print out all the tables in an SQL Server database. It shows each table's name, description and information about all its columns. I mainly use it when I start on a new project that has an existing database that I need to fully understand. This is an ASP.NET app, but it's based on the code from Jim Rutherford's ASP SQL Server Schema Printer. It's just an ASP.NET page. First you need to add your database connection string and then you upload it to your webserver. You can download it from here: Simple SQL Server Database Schema Printer (ASP.NET) more

  • Sending a list into an SQL stored procedure using XML

    I wanted to pass a list of user IDs into a stored procedure. What I really wanted was to be able to pass an array, but you're not able to do that because it would be too easy. It took me quite a while to figure this out, but now I know how, it'll be easy next time.

    There's a nice set of functions that allow you to get values from an XML string and treat the set of values like a table. Just what I wanted from arrays really.

    Here is the XML string that I used:

    <users><user id="24" /><user id="27" /></users>

    And here is the relevant part of the stored procedure I made: … more

  • 1