ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

02 Get the file name from file path in SSIS and insert into SQL table | SSIS real time scenarios

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 มิ.ย. 2021
  • Get the file name from file path in SSIS and insert into SQL table | SSIS real time scenarios
    Dts.Variables["FileName"].Value = System.IO.Path.GetFileName(Dts.Variables["FilePath"].Value.ToString());
    Download the file\script used in the Video from below link
    drive.google.com/drive/folder...
    SSIS Tutorials: • SSIS Tutorials
    SSIS real time scenarios examples: • SSIS real time scenari...
    SSIS Interview questions and answers: • SSIS Interview questio...
    Get the file name from file path in SSIS and insert into SQL table
    How do I find the filename in SSIS?
    How do I import a filename into SSIS?
    How do I get the filename in SQL?
    How would you save file names from different folders in a SQL Server table?
    If you have any questions or suggestions please comment on the video or write to me at “aqil33@gmail.com”

ความคิดเห็น • 89

  • @SuperKerr1
    @SuperKerr1 ปีที่แล้ว

    Excellent video! As always, very clear, precise and concise.

    • @learnssis
      @learnssis  ปีที่แล้ว

      Thank you so much.

  • @nareshch1989
    @nareshch1989 ปีที่แล้ว

    Thank you for making this tutorial❤

  • @manikantthakur8421
    @manikantthakur8421 11 หลายเดือนก่อน +1

    These are really Wonderful example & helping a lots taking concept also working perfectly.

    • @learnssis
      @learnssis  11 หลายเดือนก่อน

      Thank you Manikant for appreciating it.

  • @OleYoule
    @OleYoule ปีที่แล้ว

    Hi Aqil, Great tutorial as always 👍 Thank you for sharing your knowledge!

    • @learnssis
      @learnssis  ปีที่แล้ว

      You are most welcome.

  • @HarshaV44
    @HarshaV44 3 ปีที่แล้ว

    Thanks for sharing

  • @nehashahpatel1741
    @nehashahpatel1741 2 ปีที่แล้ว

    Million thanks

  • @FehmiHamiti
    @FehmiHamiti 5 หลายเดือนก่อน

    Thank you for a short and clean tutorial

    • @learnssis
      @learnssis  5 หลายเดือนก่อน

      Thank you for your response.

  • @josephberman2958
    @josephberman2958 2 ปีที่แล้ว

    Thanks, this was very helpful!

    • @learnssis
      @learnssis  2 ปีที่แล้ว

      You are most welcome Joseph.

  • @dizetoot
    @dizetoot 3 ปีที่แล้ว

    Nice! Thanks for sharing this

    • @learnssis
      @learnssis  3 ปีที่แล้ว

      Glad you liked the video.

  • @greatminds9315
    @greatminds9315 2 ปีที่แล้ว

    Thanks for quick and simple solution.

    • @learnssis
      @learnssis  2 ปีที่แล้ว

      You are most welcome Great Minds.

  • @jagmohansolanki955
    @jagmohansolanki955 ปีที่แล้ว

    Excellent video!
    Suppose, we are getting multiple file in FTP in .zip format and have to copy into local and unzip it and load files to SQL with different tables based on files name .
    please make a video on that

  • @Miss_Gabz
    @Miss_Gabz 5 หลายเดือนก่อน

    Thank you so much, it worked❤

    • @learnssis
      @learnssis  5 หลายเดือนก่อน

      Thank you Magaba.

  • @sriniwaaskorampalli8145
    @sriniwaaskorampalli8145 2 ปีที่แล้ว

    sir in variable settings in script task... ur just created two variable and one to read and another to write the result from foreach loop and put into v2. ?

  • @FlareSoul69
    @FlareSoul69 2 ปีที่แล้ว

    Thanks!

    • @learnssis
      @learnssis  2 ปีที่แล้ว

      Thank you so much for the support, although you don't need to pay anything. Happy Learning.

  • @AH-jn5ts
    @AH-jn5ts ปีที่แล้ว

    Thank you For the Video I followed the steps and inserted the CSV file but when i tried to insert an Excel File it is giving me this Error "The connection string must contain one or more components of the form X=Y, separated by semicolons." And it only inserts one File eventhough i have two In the folder.

  • @palivelasatishbhasker9696
    @palivelasatishbhasker9696 ปีที่แล้ว

    I faced errors on 2nd video practical as well. On 1st video you clarified and i also cleared by altering the table. Here im failing while fething the file . And a popup is been raised

  • @FlareSoul69
    @FlareSoul69 2 ปีที่แล้ว

    This video is gold! So if you run the SSIS a second time will the "Email" Table still exist or do we have to rename the CREATE TABLE OLEDB Destination to "Email" again? If the "Email" table does exist then all we need to do is Truncate the table for a clean run? Thanks!

    • @learnssis
      @learnssis  2 ปีที่แล้ว

      Thanks. So in real life scenario, there should be an execute sql task before the for each loop container and in the execute sql task, you can write code to may be drop and recreate the Email table every time the package will run.
      IF (EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = 'Emails'))
      drop table Emails
      CREATE TABLE [dbo].[Emails](
      [Id] [int] NULL,
      [First_name] [varchar](50) NULL,
      [Last_name] [varchar](50) NULL,
      [Email] [varchar](50) NULL,
      [Gender] [varchar](50) NULL,
      [FileName] varchar(50)
      ) ON [PRIMARY]

  • @user-ro2xv4mr2i
    @user-ro2xv4mr2i 11 หลายเดือนก่อน

    Hi Aqil, really awesome explanation. I was wandering what the steps would look like if you're loading those multiple CSV into multiple tables in SQL server and you a alter a column/ record in each CSV file ? Thanks as always.

    • @learnssis
      @learnssis  11 หลายเดือนก่อน

      Frankly speaking I have never tried that like alter a column in each csv file. Can you first load it as it is to the sql staging table and then execute the sql queries to alter a column and its value.

  • @solomong.gebrhana1204
    @solomong.gebrhana1204 ปีที่แล้ว

    I have these text files that come in every day and I need to import that to a specific table that is already created in the database(I got that part figured out). Now I need to know how to automate the process so that I don't have to do it manually every day (Like I have to change the file location every day in the SQL query to get to the new file. I also have to find and replace the " quotation because they don't want that in the table). So, I need to figure out how I can ignore that "quotation when importing to my table and how to do that daily. Schedule some kind of job so it can run daily. I am using Microsoft SQL server management studio.

    • @learnssis
      @learnssis  ปีที่แล้ว

      I have done everything what you are talking about in this video using SSIS
      th-cam.com/video/sKlDEuKnanw/w-d-xo.html

  • @jorgeesparza5114
    @jorgeesparza5114 4 หลายเดือนก่อน

    Hello Aqil, I need your help! In the minute 5:5 to 5:45 you talk about connection manager. Do you have any videos on this topic?
    I don't have any connections available in the dropdown "OLE DB Connection Manager"
    Thanks!

    • @learnssis
      @learnssis  4 หลายเดือนก่อน +1

      You need to click New and then it will open a new windows where you can provide the sql server instance name and database name.

  • @pareshyadnik4108
    @pareshyadnik4108 3 ปีที่แล้ว +1

    This is really helpful. if we have to load 50 files in 50 different tables what should be the steps..please share that video if you have

    • @learnssis
      @learnssis  3 ปีที่แล้ว +1

      Hi, I don't have the video at the moment but I am planning to make a video on this topic soon. I will update you as soon as I made a video. Thanks.

    • @jenxz10
      @jenxz10 ปีที่แล้ว

      @@learnssis Hi, have you created any video for this scenario. Really appreciate if you can share some ideas to do it with minimal manual intervention.

    • @learnssis
      @learnssis  ปีที่แล้ว

      @@jenxz10 Sorry still not created a video on this topic, will try to make a video next week.

  • @ericsos101
    @ericsos101 2 ปีที่แล้ว

    What website do you use to get this dataset ? because i am looking for a JSON File dataset.. Can you please advice?

    • @learnssis
      @learnssis  2 ปีที่แล้ว

      I usually download the data from below website
      www.mockaroo.com/

    • @ericsos101
      @ericsos101 2 ปีที่แล้ว

      @@learnssis thx

  • @NebroProg
    @NebroProg ปีที่แล้ว

    Dear Ahmed,
    I hope you are well,
    Can you please create a video to consume the data from APIs?
    Best regards,
    Alnebras.

    • @learnssis
      @learnssis  ปีที่แล้ว +1

      Hi Nebro,
      I will try to find a public api if I can find one to make a video on. Thanks.

  • @athulk9903
    @athulk9903 3 ปีที่แล้ว

    hey can you please help me i'm getting an error when specifying an folder path in for each loop container
    [Execute SQL Task] Error: An error occurred with the following error message: "Access to the path '' is denied.".

    • @learnssis
      @learnssis  3 ปีที่แล้ว

      Hi, it seems like either your path does not exists or you do not have access on the path.

  • @priyam_1007
    @priyam_1007 3 ปีที่แล้ว

    you are superman!

    • @learnssis
      @learnssis  3 ปีที่แล้ว +1

      Ha ha. This was one of the simple thing in SSIS.

    • @priyam_1007
      @priyam_1007 3 ปีที่แล้ว

      @@learnssis I am working as an intern and your videos are really helpful , you are one of the best teachers. Again thanks for existing :)

    • @learnssis
      @learnssis  3 ปีที่แล้ว +1

      @@priyam_1007 Thank you for your kind words. I am just a learner as well.

  • @sriniwaaskorampalli8145
    @sriniwaaskorampalli8145 2 ปีที่แล้ว

    sir script task is compulsory? do we need to have knowledge on c# or .net to learn ssis. i dont have knowledge on that with min of time i cannot learn them. should i go forward and learn ssis alone...to get a job?

    • @learnssis
      @learnssis  2 ปีที่แล้ว +1

      Script task code is not compulsory even if you don't have much knowledge on C# or .NET still then you can be a good developer and you can learn the basics of C# and .NET over youtube.

  • @radhac5168
    @radhac5168 2 ปีที่แล้ว

    Hi, how is the file path fetched and assigned to file path variable in for loop. Please explain

    • @learnssis
      @learnssis  2 ปีที่แล้ว

      Hi,
      you can watch my below video for more explanation on Foreach Loop container with File enumerator
      th-cam.com/video/cqw1Ce28FUs/w-d-xo.html

  • @sriniwaaskorampalli8145
    @sriniwaaskorampalli8145 2 ปีที่แล้ว

    hi sri,
    without using script task, can i directly insert the filename into sql table?

    • @learnssis
      @learnssis  2 ปีที่แล้ว

      Yes, you can.

  • @user-qh7ji6le4t
    @user-qh7ji6le4t ปีที่แล้ว

    Hi Aqil, this video for me bought some hope that anything can resolved with the available technology.
    I had a query, i saw everyone explaining how to import excel/csv file from drive, but can we import from browser/some application on daily basis or hourly and where we can store the data into MS SQL Server.

    • @learnssis
      @learnssis  ปีที่แล้ว +1

      If you need to import data from browser then you would need to write code in C# or VB.NET to read the data from browser and insert it into SQL Server. You can put that code inside SSIS package and then you can schedule SSIS package from SQL Agent job to run it any desired time.

    • @user-qh7ji6le4t
      @user-qh7ji6le4t ปีที่แล้ว

      @@learnssis Thank You So Much

    • @learnssis
      @learnssis  ปีที่แล้ว

      @@user-qh7ji6le4t You are most welcome.

  • @ChaimaHermi-zi8pq
    @ChaimaHermi-zi8pq 29 วันที่ผ่านมา

    I'm having an issue with extracting the Excel file name in SSIS. I've used a Foreach Loop and a Derived Column, but it always defaults to the first file instead of the desired one. What is the solution to this problem?

    • @learnssis
      @learnssis  29 วันที่ผ่านมา

      In the foreach loop container, in the variable mapping, map the FilePath ssis variable and also make the excel connection manager dynamic. You can watch below video to know how to configure this one.
      th-cam.com/video/TH9ptAkCHNA/w-d-xo.html

  • @sahuanalogchannel
    @sahuanalogchannel 2 ปีที่แล้ว

    Hi Aqil, I am new to ssis,
    My query is, how can we create a ssis package like when we place a particular file on a path then package first validate the file name then Execute the package.
    If there is any change in the file name package do not run.

    • @learnssis
      @learnssis  2 ปีที่แล้ว +1

      Hi Saddam,
      to achieve this what you can do, you can use a foreach loop container and use SSIS variable that will give you the full file path, now in the foreach loop container you can use an script task to get the FileName from FilePath, I have shown this in below video, using a foreach loop container and getting file name from FilePath.
      th-cam.com/video/3QQOF2KVJ1E/w-d-xo.html
      Now the next thing you need to do is declare an SSIS variable for FileName and in the Script task assign the FileName from FilePath to FileName SSIS variable.
      In above video I am assigning a value to Load file SSIS variable so you can see that how we can do that.
      You also need to put the FileName SSIS variable in the read write variables list.
      Now between the Script task and Data flow task we will use a precedence constraint and put a condition like below
      @FileName=="your file name"
      So if this condition will be true then the Data Flow task will be executed otherwise file won't be loaded.
      I have written a condition in above video as well, so you can see how we can configure the precedence constraints. Thanks.

    • @sahuanalogchannel
      @sahuanalogchannel 2 ปีที่แล้ว

      @@learnssis thank you Aqil.

    • @learnssis
      @learnssis  2 ปีที่แล้ว

      @@sahuanalogchannel You are most welcome.

  • @sriniwaaskorampalli8145
    @sriniwaaskorampalli8145 2 ปีที่แล้ว

    cant we directly use the varaiable name in derived col transformation...

    • @learnssis
      @learnssis  2 ปีที่แล้ว

      Yes, you can do that.

  • @ahtishamsattar5236
    @ahtishamsattar5236 ปีที่แล้ว

    if want to upload from MYSQL to SQL server and want table name then how i can do that?

    • @learnssis
      @learnssis  ปีที่แล้ว

      If you selecting data from MySQL from a table then you know the table name like from which table you are selecting it, you can add an additional column in the select list 'MyTable' as TableName OR you can use a derived column transformation and can create a new column and provide the table name there.

  • @NaveenK-zt8ok
    @NaveenK-zt8ok ปีที่แล้ว

    Hi Anna, while trying to execute the package, it shows an error
    "Exception has been thrown by the target of an invocation", can you help me please....
    I sent the screen shot though mail

    • @learnssis
      @learnssis  ปีที่แล้ว +2

      Hi Naveen, my name is Aqil. This question was originally asked by Anne.
      Instead of using the script task here, what you can do is Go to variables Pane, then go the FileName ssis variable go to expression and write below expression there
      RIGHT( @[User::FilePath] , FINDSTRING(REVERSE( @[User::FilePath] ) , "\\", 1) - 1)
      This will get FileName from FilePath.

    • @NaveenK-zt8ok
      @NaveenK-zt8ok ปีที่แล้ว

      @@learnssis Thanks alot bro

  • @shivarajkumar4494
    @shivarajkumar4494 ปีที่แล้ว

    [SSIS.Pipeline] Warning: Warning: Could not open global shared memory to communicate with performance DLL; data flow performance counters are not available. To resolve, run this package as an administrator, or on the system's console. I GOT THIS ERROR

  • @ericsos101
    @ericsos101 3 ปีที่แล้ว

    Can you please share the dataset

    • @learnssis
      @learnssis  3 ปีที่แล้ว

      Okay, sure. I will upload it in next 5 min.

    • @ericsos101
      @ericsos101 3 ปีที่แล้ว

      Ok thx

    • @ericsos101
      @ericsos101 3 ปีที่แล้ว

      Do you offer one on one training?

    • @learnssis
      @learnssis  3 ปีที่แล้ว

      uploaded the dataset here
      drive.google.com/drive/folders/1PZF0bC7UitqEGEoUDx8QAW0f5WIsIZ7h?usp=sharing

    • @learnssis
      @learnssis  3 ปีที่แล้ว

      @@ericsos101 I do, but I am busy this week. You can email me on aqil33@gmail.com in case you want further details for next week. Thanks.

  • @BTECH123
    @BTECH123 2 ปีที่แล้ว +1

    ssis error code dts_e_primeoutputfailed

    • @learnssis
      @learnssis  2 ปีที่แล้ว +1

      Please share the full error message.

    • @BTECH123
      @BTECH123 2 ปีที่แล้ว

      @@learnssis tq sir problem solved. I watched ur individual videos and applied in realtime. The problem is with container.

    • @learnssis
      @learnssis  2 ปีที่แล้ว +1

      @@BTECH123 Good to know that it worked for you.

    • @BTECH123
      @BTECH123 2 ปีที่แล้ว

      Sir please upload atleast 1 realtime project

    • @learnssis
      @learnssis  2 ปีที่แล้ว +1

      @@BTECH123 In each video I am showing how to do a small task of a project, so if you can learn these things then you can work on any project. At the moment I don't have one I will try to upload in future.

  • @dilipkumar-ck1nc
    @dilipkumar-ck1nc 2 ปีที่แล้ว

    At the filename
    It showing (DT_STR,50,1252)@userfilename