Getting Started with Adobe After Effects - Part 6: Motion Blur
Ask
Ask questions, discuss or help others by answering
Related Posts · View All
SQL Server 141
TSQL 75
SSRS 70
SSIS 66
XML 54

Top Categories · View All
SQL Server 141
TSQL 75
SSRS 70
SSIS 66
XML 54

How to split data into multiple excelsheets

Jan 17 2012 12:00AM by Sri   

I have one excel sheet in that 4000records so i want to load each excel sheet 100records in single excel file how to do this please explain process

Submitted under: Microsoft SQL Server · SSIS - SQL Server Integration Services ·  ·  · 


Sri
114 · 1% · 449

2 Replies

  • You can make use of OPENROWSET for that

    INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database={excel file path}', 'SELECT * FROM [Sheetname$]') SELECT required columns.... FROM ( SELECT *,ROWNUMBER() OVER (ORDER BY PK) AS Rn FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database={excel file path}', 'SELECT * FROM [Sheetname$]') )t WHERE Rn <=100

    .. PK will be key column and you need to put appropriate excel paths and also sheet name. for each sheets you need to set where condition appropriately to select 100 row batch

    If you want to automate it you need to have some kind of looping logic and also use dynamic sql to generate sheet names

    commented on Jan 18 2012 12:25AM
    visakhm
    186 · 1% · 248
  • Thank you Visakh

    Can you send to me step by step process that means which tasks and transformation used and which place write the above query

    commented on Jan 18 2012 3:01AM
    Sri
    114 · 1% · 449

Your Reply


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]