In the last couple of days at work my friend Adrian (@iknowkungfoo) and I (@adampresley) have been tossing around how we can improve performance on various portions of the application we work on. On of the trouble areas has always been large query sets that then have to be transformed into JSON for an AJAX [...]
Posts Tagged ‘SQL’
Experimenting with SQL to JSON in SQL Server 2008
Posted: 14th July 2010 by Adam Presley in C#, Development, SQLTags: C++, Development, SQL
How To Insert Multiple Records in one Insert Statement in MSSQL
Posted: 6th May 2010 by Adam Presley in Development, SQLTags: Development, SQL
A friend showed me this trick a year or two ago, and it has come in handy once again. In Microsoft SQL Server 2005 and higher if you need to insert more than one record into a database table in a single statement (kind of like how MySQL has), here is how you can do [...]
Writing C# Functions for SQL Server and CLR Integration
Posted: 15th September 2009 by Adam Presley in C#, Development, SQLTags: C#, Development, SQL
An interested problem was presented to me today where a database table in SQL Server 2005 (now moved to 2008) had a trigger attached to a table that would encrypt a credit card number on insert or update. The encryption routine used the sp_OACreate stored procedure to make use of an older Microsoft cryptography library [...]
How to Change the Owner of a SQL 2005 Table
Posted: 9th December 2008 by Adam Presley in Development, SQLTags: Development, SQL
It isn’t often that I need such a thing, but occasionally I get asked by an engineer to change the owner of a database table in MS SQL 2005. This happens sometimes, though I cannot always remember how, but changing the owner of a table is pretty easy. Just execute the following script, making sure [...]
Foray into Java
Posted: 28th February 2007 by Adam Presley in Development, JavaTags: Development, Java, SQL
So recently I’ve decided to delve into the world of Java development, or, more specifically, desktop Java development. So far I am liking it. My first task was to write a small application that would accept two dates as input and spit out a tab-separated report of first and last journal entries in a system, [...]
Images in SQL
Posted: 9th February 2007 by Adam Presley in C#, DevelopmentTags: C++, Development, SQL
So I was presented with a task today of extracting images that were stored in a Microsoft SQL Server 2000 database and save them as JPEG files. Here is a bit of code that will do this. In this code sample I am assuming domain authenticated SQL login. The table name here will be called [...]

