Export data from SQL Server to excel - skip first 4 rows in excel sheet

Who is online?  0 guests and 0 members
Home  »  Forums   »  microsoft business intelligence   »  integration services   » Export data from SQL Server to excel - skip first 4 rows in excel sheet

Export data from SQL Server to excel - skip first 4 rows in excel sheet

Topic RSS Feed

Posts under the topic: Export data from SQL Server to excel - skip first 4 rows in excel sheet

Posted: 4/13/2012

Padawan 172  points  Padawan
  • Joined on: 2/16/2010
  • Posts: 51
Hi, I know how to export data to excel.

My question is: I have excel template, I can say first 4 rows are headers,
so I want insert data from 5th row, is this possible in SSIS?

Thanks


Posted: 4/13/2012

Padawan 1251  points  Padawan
  • Joined on: 4/22/2010
  • Posts: 23
Answered  Answered

Yes you can do this.  There are two ways I can think of off the top of my head.  The firs is to view the properties of the Excel Sourc Component set Access Mode to "Open Rowset", then on the Open Rowsset Property specify the Excel Tab and the Starting and ending cell.  For instance 'Sheet1$A5:T'  This would start in the first column on the 5th row of data and go all the way out to 20th or so column.  In this instance I left "T" with out a row specification since the numbers of rows might be unknown. 

The other way is to do it through a variable, Set the Access Mode to OpenRowsetVariable, then create a string variable and put the same format as before ('Sheet1$A5:T') inside the variable.  The reason you might want to do this is to make the package dynamic, or to loop through the various sheets in an excel page and store the values for the Rowset in a table.

Hope this helps.


Posted: 4/13/2012

Padawan 172  points  Padawan
  • Joined on: 2/16/2010
  • Posts: 51

I want to export data from sql to excel destination, is your solution works for excel destination?

Thank you


Posted: 4/16/2012

Padawan 172  points  Padawan
  • Joined on: 2/16/2010
  • Posts: 51

Thank you for your reply, here I found the solution, same exact solution what you gave me, they gave step by step documentation, thanks again.

http://www.sqlservercentral.com/Forums/Topic866686-364-1.aspx

 


Page 1 of 1 (4 items)