Contents tagged with SQL

  • Bridge statistics, manga and SQL

    I didn't enjoy stats at school very much. It seemed a very dry subject that involved a lot of tedious calculations and I didn't really see the point. Perhaps if we'd been encouraged to use computers to do the tedious stuff and been given data sets that were more interesting I'd have realised that actually stats can be a very interesting subject.

    After reviewing and enjoying The Manga Guide to Relativity, I was excited to be sent a copy of The Manga Guide to Statistics to review. It inspired me to look at statistics again. Perhaps they do have a point, perhaps with some interesting data and … more

  • 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