Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. how to create dynamic excel sheets based on conditions in ssis

how to create dynamic excel sheets based on conditions in ssis

Scheduled Pinned Locked Moved Database
tutorialsql-server
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vasu12
    wrote on last edited by
    #1

    Hi I have one doubt in ssis, how to create dynaimic excel sheets based daily running using below conditions : conditions: if current date(systemdate) dayname is monday then i want load previouse year data(currentyear-1) and should be

    create dynamic monthandyear sheetname and corresponding data: example: suppose today is monday then my packge should be load only pervious year data in the excel file and excel file should be contain monthandyearsheetsofpreviousdata. here:excelfilename is :2017 and sheetsname:jan2017..>this should contain only jan2017 related data,2nd sheet for feb2017: this file only feb2017 related data only, for march2017 sheet:its should contain only march2017 data similary upto dec2017 sheets create dynamicaly.

    if current date(systemdate) dayname is tuesday then want create dynamic sheet for previous month data of current year:

    example: supuose today is tuesday then i want load data only previous month of currentyear data into the excel sheet:that means we need load only january2018 data only in excel file.

    if current date(systemdate) dayname is Wednesday then want create dynamic sheet for previous last 3 months data from current date: example:upuose today is Wednesday then i want create excel sheets dynamicaly only for last 3 months of current data sheets : Jan2018,dec2017,nov2017 sheets with corresponding data.

    if current date(systemdate) dayname is Thursday then want create dynamic sheet for previous year of may month data only : example:upuose today isThursday then i want create excel sheets dynamicaly only for may month data sheet: may2017 sheets with corresponding data.

    if current date(systemdate) dayname is Friday then want create dynamic sheet for previous year related August and september and December months data : example:upuose today is Friday then i want create excel sheets dynamica only for previous 3 required months data sheets: Aug2017,sep2017,Dec2017 sheets with correspondin data.

    if current date(systemdate) dayname is Saturday then want create dynamic sheet for previous year related August month data : example:upuose today is Friday then i want create excel sheets dynamica only for previous August required months data sheets: Aug2017 correspondin data. please tell me how to achive this task in ssis:

    souce table: emp

    CREATE TABLE [dbo].[emp](
    [country] [varchar](50) NULL,
    [empname] [varchar](50) NULL,
    [doj] [date] NULL
    ) ON [PRIMARY]
    GO
    INSERT [dbo].[emp] ([country], [empname], [doj]) VALUES (N'INDIA', N'hari', CAST(N'2017-10-12' AS

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups