Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 How to do this with BIDS

Author  Topic 

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2012-10-24 : 16:37:02
I want to do something very simple in BIDS as a means to learning more about what I can and cannot do. Basically I want to:

1. run a query that returns a single data item (e.g. select 1 as one)

2. output that data to a flat file (or to excel or even to the BIDS output panel, if that is possible)

To get started, I added an Execute SQL Task element to the Control Flow tab, where I typed my simple query (select 1 as one). That works as expected. Now, I'd like to send the result set (Which is just one row and one column) to a file. So, I added a Data Flow task, but BIDS doesn't like that, complaining that the number of input columns is 0 (even though I know it is 1).

So, I guess I'm going about this wrong. How can I do this very simple thing in BIDS?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-24 : 17:21:08
nope. no need of EXECUTE SQL TASK. you should be using a DATA FLOW TASK with OLEDB Source and flat file destination. Put data access mode as as sql command and put your query in it. Point flat file destination to a file connection which creates a file and on executing you'll get results exported to file

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2012-10-25 : 09:19:14
Hey, that worked! I'm on my way!!
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2012-10-25 : 09:44:14
ONe question though: IT seems that I need a connection on the OLEDB source task even though it will never use it. (I think that's why I went for Execute Sql Task in the first place). Is there a way to run it without a source connection?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-25 : 10:06:35
quote:
Originally posted by gbritton

ONe question though: IT seems that I need a connection on the OLEDB source task even though it will never use it. (I think that's why I went for Execute Sql Task in the first place). Is there a way to run it without a source connection?


what do you mean by you never use it? you've run your query against a db isnt it? even EXECUTE SQL TASK needs a connection

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2012-10-25 : 11:32:58
Never mind. I get it now
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-25 : 11:38:38
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -