4. T-SQL Programming SELECT *, CASE WHEN EXISTS ( SELECT g.giftid FROM V_gift_fiscal_year AS fy INNER JOIN gifts AS g ON fy.giftkey = g.giftkey WHERE fy.giftid = idnum AND giftprocdt BETWEEN '7/1/02' AND '4/21/03' AND g.gifttype IN ('g', 'y') ) THEN 1 WHEN EXISTS ( SELECT g.giftid FROM V_gift_fiscal_year AS fy INNER JOIN gifts AS g ON fy.giftkey = g.giftkey INNER JOIN relation ON fy.giftid = relid WHERE relrelatid = idnum and relisa IN ('sp', 'dsp', 'spnm', 'lp', 'lpnm') AND giftprocdt BETWEEN '7/1/02' AND '4/21/03' AND g.gifttype IN ('g', 'y') ) THEN 1 ELSE 0 END AS Donor INTO #grad FROM #alums INNER JOIN #fy ON GradYear < fy SELECT fy, Cast(table_val AS char(25) ) AS School, Count(DISTINCT idnum) AS Alums, Sum(Donor) AS Donors FROM #grad INNER JOIN school_names ON coreprfsch = table_code GROUP BY fy, table_val ORDER BY fy DESC, table_val COMPUTE Sum(Count(DISTINCT idnum)), Sum(Sum(Donor)) BY fy Checks for Alumni Participation rates for each school and college including gifts from both constituents and their spouses/significant others.
5. SQL ServerIntegration Services (SSIS) Master Package that controls the execution of subsidiary packages for importing data into a staging database for a construction company.
7. SQL ServerIntegration Services (SSIS) VB.Net Script to update the insert, update, and error counts for the current file being processed and for the grand totals. Imports System Imports System.Data Imports System.Math Imports Microsoft.SqlServer.Dts.Runtime Public Class ScriptMain ' Updates the body of the results email. Public Sub Main() ' Displays counts for each file. Dts.Variables("EmailBody").Value = Dts.Variables("EmailBody").Value.ToString _ + Dts.Variables("TimesheetFile").Value.ToString + ": " _ + Dts.Variables("FELInsertCount").Value.ToString + " inserts, " _ + Dts.Variables("FELUpdateCount").Value.ToString + " updates, and " _ + Dts.Variables("FELErrorCount").Value.ToString + " errors." + vbCrLf ' Updates the total counts. Dts.Variables("ErrorCount").Value = CInt(Dts.Variables("ErrorCount").Value) + CInt(Dts.Variables("FELErrorCount").Value) Dts.Variables("InsertCount").Value = CInt(Dts.Variables("InsertCount").Value) + CInt(Dts.Variables("FELInsertCount").Value) Dts.Variables("UpdateCount").Value = CInt(Dts.Variables("UpdateCount").Value) + CInt(Dts.Variables("FELUpdateCount").Value) Dts.TaskResult = Dts.Results.Success End Sub End Class