How to return T-SQL query with column names as first row
问题 I'm writing a SSIS package to output data from a SQL Server 2012 database to a .CSV file for a client. The requirement is that the first row be the column names. Below is the query I've written for the Source in the Data Flow Task. The problem is, it always returns the column names as the LAST row, not the first. Why? How do I achieve this? DECLARE @Today AS DateTime= GETDATE() DECLARE @NextPayrollDate AS DateTime EXEC mobile.getNextPayrollDate @Today, @NextPayrollDate OUTPUT ;WITH