Author Archives: Russ

About Russ

Russ Loski is a data warehouse developer focusing on SSIS and SQL Server development. He has worked with SQL Server since 1998. He has used various technologies to move data from one source to others. He has worked for well-known companies such as the Bank of America, the Dallas Cowboys Football Club, T-Mobile and Coca Cola Enterprises. Currently he is developing a Data Warehouse for a large health care organization.

Adding processing instructions and comments using XSLT

I have been playing with XSLT. I have learned how to return the entire XML document, adding an attribute here, an element there. But how do you insert a processing instruction or comment into your document? This XSLT will simply … Continue reading

Posted in XML, XSLT | Leave a comment

Getting metadata from query using sp_describe_first_result_set

One of the tasks that eats a lot of my ETL development time is documenting the views and procedures I write. I need to know where exactly the data is coming from. sp_describe_first_result_set provides a flag for outputting the source … Continue reading

Posted in Documentation, ETL, Testing, TSQL | Leave a comment

Using a temporary table to handle sp_describe_first_result_set

In a previous post (Easing the Testing Stored Procedures with Temporary Tables) I introduced the sp_describe_first_result_set stored procedure. This procedure works like sp_executesql, except that it returns the columns that a query returns rather than the results of the query. … Continue reading

Posted in Testing, TSQL | Leave a comment

Using view as source for application

Recently someone posed a puzzling question on the MSDN forums (How to reorder a column in a table which also has a foreign key). They needed to be able to add columns to a table in a specific order. If … Continue reading

Posted in ETL, Testing, TSQL | Leave a comment

Splitting strings in SQL Server

One of the query pains in SQL Server involves a simple split of a string. You want to pass into a stored procedure a comma delimited list of items and use that in your procedure. In order to get a … Continue reading

Posted in TSQL | Leave a comment

Easing the Testing Stored Procedures with Temporary Tables

I think that we would all agree that we should test our code before we release it.  Sometimes it very easy to do so. For example, testing a view is not difficult.  Say you had to make a small change … Continue reading

Posted in Testing, TSQL | Leave a comment

Displaying parameterized string in SQL Server

One of the things that I do frequently is to put together some message that involves a template filled in with variables. For example, I want my error message to fit a certain pattern. Or I want to put a … Continue reading

Posted in TSQL | Leave a comment

Solution appropriate to user

I am working on a small project for a small non-profit company. It has been an interesting project that could involve a variety of interesting technologies. But if it is going to be useful, that company needs to be able … Continue reading

Posted in Consulting, Solutions | Leave a comment

SSIS Script Component – Last Row

One problem that you might encounter with data is where you are gathering information from multiple lines and want to output only one line. If you are going to simply aggregate the results, then you can use the Aggregate transformation. … Continue reading

Posted in ETL, SSIS Script | Leave a comment

SSIS Pivot Transformation with Multiple Set Keys

When you pivot data, there are three dimensions that you need to set: the Set Keys, the Pivot Keys and the Pivot Values (to use the SSIS terms). In Excel it is very easy to select multiple Set Keys (ROWS), … Continue reading

Posted in ETL, Pivot, SSIS | Leave a comment