SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Archives: June 2013

Comparing Previous Rows in SQL

I had a client recently that needed me to get the direction a student’s GPA was headed on a regular basis.

To do this I needed to get the last GPA record on the table and the previous GPA. The dates on these rows were different for different schools and…

Read more

0 comments, 604 reads

Posted in Mike Davis SQL on 24 June 2013

Pivoting weird data in SSIS – Sort of…

Sometimes we get data in some bad forms. For example look at the below table:

The names and the amounts are comma separated in two different columns. Let’s imagine we need to get this data into a table like the one below:

Notice the column names are the names that…

Read more

0 comments, 1,702 reads

Posted in Mike Davis SQL on 17 June 2013

SSRS – Using a Parameter to make Dynamic Columns

Multiple value parameters are a common tools used in SSRS. You can use this tool to select which columns actually show on a report. You will need to create a multiple value parameter and place an expression on each column on the report. More specifically the expression needs to be…

Read more

6 comments, 3,255 reads

Posted in Mike Davis SQL on 10 June 2013

AS400 Program from SSIS

If you need to call an AS 400 program from an SSIS package this can easily be accomplished with an Execute SQL Task. This can be made even easier with two variables and an expression too. The AS400 program QCMDEXC is usually called using the CALL QSYS.QCMDEXC command. This is…

Read more

0 comments, 628 reads

Posted in Mike Davis SQL on 3 June 2013