August 1, 2017 at 1:59 pm
Hello,
I am trying to set up an integration services package to export the results of a query to a .csv file. I set it up according to the Stairway to Integration Services (http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/72492/). I am running into trouble adding an OLE DB Source. I am using 'SQL Command' for the data access mode. The query previews exactly as expected but when I select 'Columns' on the left pane there are no columns listed. I am using SQL 2005. My connection manager is good, connection tests ok. Can anyone offer any insight? Thank You in advance for taking the time to read my question.
August 1, 2017 at 2:41 pm
are your columns named?
That is, if you are using aggregates, are you providing an alias to the column?
Like a "SELECT SUM(dollars) FROM table" won't have a column name for that. BUT "SELECT SUM(dollars) AS TotalMoney FROM table" would.
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
August 1, 2017 at 2:55 pm
I do have two expression columns but they are aliased. Everything shows up properly in the preview.
August 1, 2017 at 3:04 pm
Then I am not sure. Sorry about that. I've not seen that before except when I end up with an unnamed column.
Any chance that 2 columns ended up with the same name? Like one of your aliased ones is the same name as another?
I've also not built any SSIS packages against SQL 2005.
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
August 1, 2017 at 3:19 pm
is your source a stored procedure call, or a query?
a stored procedure call would need SET NOCOUNT ON as, multi statements, like workign with temp tables, affects the way a driver can find the shape of the results.
It's also possibl the procedure might require a WITH RESULTSETS command, either inside or outside of the procedure call.
like
WITH RESULTSETS
(
(
column1 int not null,
column2 varchar(50) NULl
)
)
Lowell
August 2, 2017 at 8:15 am
Thanks for your replies, all. If I pull the data from a table rather than a SQL command it works fine so I'm just going to do that.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply