143 How to import multiple excel files into sql server using ssis

Поділитися
Вставка
  • Опубліковано 2 лис 2024

КОМЕНТАРІ • 92

  • @pallavikrishna7591
    @pallavikrishna7591 Місяць тому

    Thank you so much!!! Very Crisp and clear , as always

  • @ArwaAldoudOmer
    @ArwaAldoudOmer 4 місяці тому

    Thanks, it was amazing. I followed the steps and it worked perfectly. Thank you 🥰

    • @learnssis
      @learnssis  4 місяці тому

      Glad it worked for you.

  • @dilipchauhan5598
    @dilipchauhan5598 8 місяців тому

    Simple and on point!

    • @learnssis
      @learnssis  8 місяців тому

      Thank you Dilip.

  • @DeUraq
    @DeUraq Місяць тому

    Excellent one and it worked with me! I have a quick question. If my excel files are their respective folders with the same file names, the how to use the dynamic variables? like c:\data\emp1\emp1.xlsx, c:\data\emp2\emp2.xlsx etc. Thank you

    • @learnssis
      @learnssis  Місяць тому +1

      Thanks, in that case either you can give path of parent folder like
      c:\data
      and then tick the option traverse sub folder and it will try to find files from sub folders (emp1,emp2) as well.

    • @DeUraq
      @DeUraq 25 днів тому

      @@learnssis thanks for the reply. if I have multiple excel files (up to 50 files) as (emp1.xlsx, emp2.xlsx ...emp50.xlsx) and load them to sql table emp1 to emp50 . Do i have have to create a different workflow for 50 times for each table to load data?!

    • @learnssis
      @learnssis  24 дні тому +1

      @@DeUraq If the layout of all files is same then you can use a single data flow task with foreach loop container to load them, however if their layout is different then you can create separate data flow for each file.

  • @LocNguyen-cr7tm
    @LocNguyen-cr7tm 3 місяці тому

    why I see no any data connection afer clik "new" in OLE DB connection manager step ?? help me please

  • @lifeisawesome4566
    @lifeisawesome4566 4 місяці тому

    Thanks for this great tutorial.
    I have a question: If files are in SharePoint, is this approach will work?

    • @learnssis
      @learnssis  4 місяці тому

      No. If the files are at sharepoint then first you would need to download the files from sharepoint to a folder on the server and then you can use this method.

  • @lonestarparrot
    @lonestarparrot Рік тому

    Great tutorial and very easy to follow!!! Thanks @Learn SSIS

  • @afiqghazali6826
    @afiqghazali6826 8 місяців тому

    Hi there, great tutorial.
    In minute 4:59 you selected ExcelFilePath and the expression is User::FilePath.
    If im flat file source(.csv), what option should I choose?

    • @learnssis
      @learnssis  8 місяців тому +1

      In flat file source, we will be using the flat file connection manager and in flat file connection manager we would need to use Connection String property.
      ua-cam.com/video/QDSRzGxLe1g/v-deo.html

  • @shaneparkes7105
    @shaneparkes7105 2 роки тому

    Thank you, I would move uploaded files to another folder instead, this should help if ever a file needs to be replaced, not sure how it will handle when there is no file present though. I will also add an identifier to the filename to avoid duplicate filenames

    • @learnssis
      @learnssis  2 роки тому +1

      Moving the processed files to another folder is also a good approach, it will work fine if there are no files to process. You can watch a video on this one here
      ua-cam.com/video/RVRAuFWrMcE/v-deo.html

  • @samderrty123
    @samderrty123 Рік тому

    the microsoft access database engine cannot open or write to the file. But I do not have it opened. any ideas?

  • @prashantsinha123us
    @prashantsinha123us 10 місяців тому

    Thanks, It was good and all easily understandable

    • @learnssis
      @learnssis  10 місяців тому

      Its good to know Prashant that you found the video useful.

  • @vochau9806
    @vochau9806 Рік тому

    Do you have a video that load Dim and Fact table from an Excel file. For example, I have a E-com data, I want to load to Dim and Fact table. Thank you so much

    • @learnssis
      @learnssis  Рік тому

      No I don't have a video on that one. but loading a Dim and Fact table from excel file is as simple as loading it from CSV file. The only change for excel will be that instead of flat file source, now you would need to use excel source. And if in the destination table the data type is varchar, then you would need to add a data conversion task before the lookup transformation and it can convert the data type to varchar those you can use inside lookup transformation. I have made videos on loading data to Dim and Fact tables and on Data conversion task as well.
      ua-cam.com/video/c2lSKLQPb_I/v-deo.html
      ua-cam.com/video/duaR_PhLdmc/v-deo.html
      ua-cam.com/video/aQJCky2qfCs/v-deo.html

  • @shival7096
    @shival7096 2 роки тому

    Excellent one. Please do a video on importing multiple excel files into sql server as separate tables with scheduled incremental refresh.

    • @learnssis
      @learnssis  2 роки тому

      Sorry did not get this one completely. You mean each excel file will be loaded to a separate table ? Then how it will be incremental ?

    • @shival7096
      @shival7096 2 роки тому

      @@learnssis yes, i mean when data changes in excel it need to update in sql server on a schedule.

    • @learnssis
      @learnssis  2 роки тому

      @@shival7096 Okay got it. but you want to update data to multiple tables. If we can write the code for one table then we can use the same logic for another table as well. If we will create video doing it for multiple tables then the video can be very lengthy.

    • @shival7096
      @shival7096 2 роки тому

      @@learnssis Got it , thank you so much.

  • @farzadsaedi1954
    @farzadsaedi1954 9 місяців тому

    Very good tutorial. Can you please show how multiple excel file can be transferred from SharePoint folder to Sql Server? thanks

  • @funbutterjam4734
    @funbutterjam4734 Рік тому

    We have 3 tables it have millions record. so last 3 year before data move source to stg table and then stg to archival and delete record from source and stg table after moved archival (source and stg table same server but archival is different server). How to create siss package. please make one video.

  • @beyzanuraltikardes2743
    @beyzanuraltikardes2743 8 місяців тому

    I want to do this for excel files in different folders in the same project for example with 2-3 foreach loop containers. is it possible?

    • @learnssis
      @learnssis  8 місяців тому +1

      Yeah you can use multiple foreach loop containers, one foreach loop container with one folder.

  • @kichuchinnu3303
    @kichuchinnu3303 2 роки тому

    Hiii ,
    Can you suggest your video for ODBC destination in ssis package

    • @learnssis
      @learnssis  2 роки тому

      This is one of the video for ODBC destination
      ua-cam.com/video/JPn_t60tGCw/v-deo.html

  • @sureshareti2843
    @sureshareti2843 2 роки тому

    Good one bhaiyya... Thanks alot.... I request you do one video on Source Excel Read all excel header with data dynamically based on that create table dynamically in sql server and map columns dynamically excel source and sql server destination and load the data

    • @learnssis
      @learnssis  2 роки тому +1

      Thank you. In data flow task, SSIS does not allow to change the columns dynamically using the excel source. We can only use Script task and write all code there may be in C# or VB.NET

    • @sureshareti2843
      @sureshareti2843 2 роки тому

      @@learnssis thanks for clarification bhaiyya

  • @iNtellectual.paradoX
    @iNtellectual.paradoX 2 місяці тому

    Bro when i select excel with xlsx extenstion in excel source I do not get name of excel sheet.it says no table or view could be loaded. same is working fine with .xls extention.
    Plz help.

    • @learnssis
      @learnssis  2 місяці тому +1

      Try to Install Access database engine drivers from here and try again
      drive.google.com/drive/folders/1iTtcu6EMuRMjCPnLnIkr-QfePEfJPwny
      First install 32-bit and try and if that does not works then install 64-bit. If you face any issue installing 64-bit then uninstall the 32-bit drivers and then install 64-bit.

    • @iNtellectual.paradoX
      @iNtellectual.paradoX 2 місяці тому

      @@learnssis Thank you so much bro. :)

  • @bzflowerbee
    @bzflowerbee Рік тому

    Is there an alternative way to do this without ssis? Our company has 2017 visual studio and there isn't a business intelligence on visual studio available 😢

    • @learnssis
      @learnssis  Рік тому +1

      You can use C# as well to import all excel files form a folder to sql server tables.
      ua-cam.com/video/KzuA7ImEAJE/v-deo.html

    • @bzflowerbee
      @bzflowerbee Рік тому

      @@learnssis but I don't know c#. Thank you.

    • @learnssis
      @learnssis  Рік тому

      ​@@bzflowerbeeThen you can manually import them.

    • @bzflowerbee
      @bzflowerbee Рік тому

      @@learnssis I know 😭😭

  • @newtechnofayda
    @newtechnofayda 2 роки тому

    Good

  • @putrigilang1516
    @putrigilang1516 Рік тому

    Hi I've edited the expression and it turns out error "the acquire connection method call to the connection manager failed with error code 0xC0202009" can you help me with this?

    • @learnssis
      @learnssis  Рік тому +1

      Set the DelayValidation property of SSIS package to True. And you should be good if the excel file schema is same.

  • @vochau9806
    @vochau9806 Рік тому

    Hello, I build a SSAS to load data from SQL server. Firstly, I load fact table 500 lines. I deploy SSAS also load 500 lines. However, when I update the fact table by SSIS increate to 600 lines. SSAS does not load enough to 600 line. I have to process SSAS again, it loaded to 600 lines. But when I deploy SSAS again, it still loads 500 lines. Therefore, the Excel report does not refresh. How do I fix this. Thank you for your help

    • @learnssis
      @learnssis  Рік тому

      Hi Vo Chau, frankly speaking I don't have any experience working with SSAS thus not sure what might be wrong here, sorry for that.

  • @zoyasaleem5689
    @zoyasaleem5689 Рік тому

    please let me know how to SSIS package call from job and run automatically at configure time please

    • @zoyasaleem5689
      @zoyasaleem5689 Рік тому

      i am stuck please

    • @learnssis
      @learnssis  Рік тому

      Hi Zoya Saleem, Take a look at this video, I have shown this in detail
      ua-cam.com/video/qrV2FbQpU3I/v-deo.html

  • @ziadbensaada
    @ziadbensaada 6 місяців тому

    not working for me! it import one file only in sql server with flag x in the schema of excel source ? i dont know whaat is the problem?

    • @learnssis
      @learnssis  6 місяців тому

      Maybe you can take a look at this video and use this code inside foreach loop container and pass the FilePath to Script task to import multiple excel files
      ua-cam.com/video/zQ3syUsAzYY/v-deo.html

    • @ziadbensaada
      @ziadbensaada 6 місяців тому

      @@learnssis but i have many files excel i wanna add them to one table in sql server , when i change the runtime not working told me not supported

    • @learnssis
      @learnssis  6 місяців тому

      @@ziadbensaada What is the error message ? And How you are trying to do it for all excel files ?

  • @priyavishalkulkarni2415
    @priyavishalkulkarni2415 7 місяців тому

    The same steps are followed.
    The only difference is that I have a CSV file.
    But getting data from only the first file.Not the second one.
    And if I execute the package again then the same rows are added repeatedly.

    • @learnssis
      @learnssis  7 місяців тому +1

      Hi Priya,
      the video you are referring is for loading multiple excel file and to load multiple csv files you can watch this video
      ua-cam.com/video/BjpaSxMZMxs/v-deo.html
      I think you have not configured the flat file connection manager correctly. You would need to make it dynamic, by passing the file path to connection string property using expressions. Thanks.

    • @priyavishalkulkarni2415
      @priyavishalkulkarni2415 7 місяців тому

      @@learnssis
      Thank you for your quick response.
      Now the package is working fine.
      But the only issue is records from the second file from SSIS come with double quotes.

    • @learnssis
      @learnssis  7 місяців тому

      @@priyavishalkulkarni2415
      In the flat file connection manager, put the double quote " in the text qualifier option.
      ua-cam.com/video/KA-u6oVkWw0/v-deo.html

    • @priyavishalkulkarni2415
      @priyavishalkulkarni2415 7 місяців тому

      But I don't have quotes in my flat file.@@learnssis

  • @decentmendreams
    @decentmendreams Рік тому

    Hi , do you provide consulting services ?

    • @learnssis
      @learnssis  Рік тому

      Sorry right now I am very busy and don't provide consulting service.

  • @HeadshotAndCruise
    @HeadshotAndCruise 8 місяців тому

    I am Getting below mentioned two error while importing multiple excels. When I run the package the data in excel mentioned in log got imported and the package terminates with the following error. Can you please suggest what wrong I am doing.
    [Excel Source [84]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
    [Excel Source [84]] Error: Opening a rowset for "MASTER_FEB_2024$" failed. Check that the object exists in the database.

    • @learnssis
      @learnssis  8 місяців тому

      It seems like MASTER_FEB_2024$ sheet name does not exists in the excel file.

    • @HeadshotAndCruise
      @HeadshotAndCruise 8 місяців тому

      But the file is there because when i run the package the rows of this excel got imported, after that it gives this error. Also in the log it shows package return the status success
      @@learnssis

    • @learnssis
      @learnssis  8 місяців тому

      @@HeadshotAndCruiseSet the delay validation property of package to success. And make sure that you have followed other steps like made the excel connection manager dynamic by setting the excel file path property from ssis variable And getting the sheet name dynamically using the C# code.

  • @vochau9806
    @vochau9806 Рік тому

    Hello
    When I manual write this command in SQL Insert into TableA (a1,a2,a3, FileName) Select a1, a2, a3, ‘abc.txt’ from Table . This SQL works. No problem
    But when I create a variable in SISI
    "Insert into TableA (a1,a2,a3,FileName) Select a1,a2,a3," + @[User::FileName] + " from TableB" .it does work
    The error is
    [Execute SQL Task] Error: Executing the query "Insert into [Table A].." failed with the following error: "The multi-part identifier "FileName230123.TXT" could not be bound.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Could you please help me. I try to search but cannot resolve. Thank you very much

    • @learnssis
      @learnssis  Рік тому

      Try this one
      "Insert into TableA (a1,a2,a3,FileName) Select a1,a2,a3,'" + @[User::FileName] + "' from TableB"

    • @vochau9806
      @vochau9806 Рік тому

      @@learnssis I see what I am wrong. just a '. Thank you so much

  • @OleYoule
    @OleYoule Рік тому

    Hi Aqil, Thank you for your tutorials 👍. I got huge amount of useful information) Could you please make video how to record sheet names in extra column inside main database (main sql table) for each data record(line). For instance if excel file has multiple sheets Sheet1, Sheet2, and so on they have to be added to each record inside main database(main sql table). Thank you in advance!

    • @learnssis
      @learnssis  Рік тому

      Sure will try to make a video on this one.

    • @learnssis
      @learnssis  Рік тому

      Hi,
      if you want to import multiple excel sheet then you can take a look at this video
      ua-cam.com/video/1YELvo4FCKE/v-deo.html
      And if you want to add a new column Sheet Name to the data flow and want to import it to a sql server table, then you can use a derived column transformation and in the derived column transformation just drag and drop the sheet name ssis variable into Expression and create a new column SheetName, this will create a new column SheetName with the value from SSIS variable Sheet name, then you can map this column with your sql server destination table.
      I have done the similar kind of thing in below video by creating a new column FileId
      ua-cam.com/video/BjpaSxMZMxs/v-deo.html

    • @OleYoule
      @OleYoule Рік тому

      @@learnssis Hi Aqil, thank you for your tip. Changes based on your recommendations were implemented and SSIS task works perfectly! You are the best SSIS tutor👍

    • @learnssis
      @learnssis  Рік тому

      @@OleYoule Glad it worked for you.

  • @TheMan-wd1pv
    @TheMan-wd1pv 2 роки тому

    i heard sql and msbi vanished many years ago is it true

    • @learnssis
      @learnssis  2 роки тому +3

      I am working on these technologies for last 13 years and still I see a lot of jobs in these areas. SQL Server is the widely used database management system in the world.

    • @piraviperumal2544
      @piraviperumal2544 2 роки тому

      @@learnssis Very true

  • @akramabushmais2949
    @akramabushmais2949 Рік тому

    I need help I did the same steps and I have two excel sheet in the folder but when I applied the steps and check the database I found one of the excel twice in the database table how can I solve this !!?
    Thanks
    @leanssis

    • @learnssis
      @learnssis  Рік тому +1

      Did you made the excel connection manager dynamic by going to expressions of excel connection manager and setting the ExcelFilePath property to come from the variable as shown in the video ?

    • @akramabushmais2949
      @akramabushmais2949 Рік тому

      @@learnssisyes I found the problem (I read the wrong extensions ) I’m sorry to interrupt you thank you again for the great UA-cam channel it is very helpful ✌️

    • @akramabushmais2949
      @akramabushmais2949 Рік тому

      @@learnssisone more question If I already have table in database I just need to don’t choose fast load in database and choose the existing table in database and do the correct mapping in mapping option right !

    • @learnssis
      @learnssis  Рік тому +1

      @@akramabushmais2949No problem, you are most welcome.

    • @learnssis
      @learnssis  Рік тому +1

      @@akramabushmais2949Just choose the fast load option and select the table from the database.

  • @learner_SSIS
    @learner_SSIS Рік тому

    Good sir 😀