SQL Query | Load data from CSV file into database table | BULK INSERT | OPENROWSET

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ก.ย. 2024
  • In this tutorial, we take a look at two ways using SQL Query to load data from a csv file into a database table.
    We use the BULK INSERT and OPENROWSET functions.
    Below is the link to all SQL statements related to this video -
    know-star.blog...
    Microsoft documentation on OPENROWSET and BULK INSERT
    docs.microsoft...
    docs.microsoft...
    Must Do Data Analytics Certifications -
    Google Data Analytics Professional Certificate
    imp.i384100.ne...
    Google Advanced Data Analytics Professional Certificate
    imp.i384100.ne...
    Practice SQL Queries on Your Browser through Interactive Courses -
    learnsql.com/?...
    Please do not forget to like, subscribe and share.
    For enrolling and enquiries, please contact us at
    Website - knowstar.org/
    Instagram - / learn.knowstar
    Blog - know-star.blogs...
    Facebook - / knowstartrainings
    Linkedin - www.linkedin.c...
    Email - learn@knowstar.org

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

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

    Why would anyone use second method? Its complicated and requires lots of preparation so i wonder if it is any real purpose, or its presented just as example that its possible?
    Sorry for maybe stupid question.
    Btw i use regular instrument "import data" in oracle sql developer, thanks to your video i understand deep processes, taking place on importing via tool so anyways educating, thank you

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

      Thank you for your comment. It is a very good point. The advantage of the second method is that it also allows you to just read the data and hold it for intermediate operations without an actual need to insert the data in a physical table.

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

    Wonderfully well explained. Really solved my problem 👍

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

    Great Efforts From You Mam Thank You So Much🙏🙏🙏

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

    Thank you so much... Your videos very helpful

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

    Another great tutorial. Thanks!

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

    Gonna need this.

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

    Hello, thank you for this video it was helpful. Nevertheless, in my case; I need to be repeating this procedure every morning with new dataset of equal columns, so that the table in my database is updated on a daily, does the bulk insert and openrowset solve this? Thanks

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

      Ideally it should.
      Just set a job in oracle job scheduler which will run every sysdate.

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

      @@rajarshibose4454 but I'm using MS SQL Server though

  • @prateekkumar-xc6uo
    @prateekkumar-xc6uo 4 หลายเดือนก่อน

    I am getting this error : Cannot bulk load. The file "C:\Users\prate\OneDrive\Documents.csv" does not exist or you don't have file access rights.

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

    useful to me,thanks a lot

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

    Very helpful

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

    God bless your great efforts in this channel.
    I have a simple question to ask as a newbie sql learner.
    Could i manage to channel or extract all sql data generated from an accounting program (based on sql) to our new sql server.
    The reason that we are bounded with the graphical interface of this accounting software as we cant
    come up with any solutions regarding analytics and automation, unless we can tailor and rearrange this sql database based to our specific needs.
    Thanks for helping me.

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

      You would need to design some data migration process. It could be as simple as extracting data as CSV files and loading in database. Or if data is complex and high volume some external tool might need to be used 🙏

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

    It's usefull to all

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

    Hello, very informative video. looking forward to learn more from you.
    As a newbie to the SQL language, i am wondering if there are any limitations or drawbacks if i start as a beginner to work
    with Microsoft SQL Server 2008 Express. (old version)
    The reason that i am bounded with my pc hardware specification and windows 7 installed, but I am still eager to learn this language no matter what the boundaries are.

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

      Thank you.
      Some functions which have been introduced in later versions will not work. For ex- String_Split. Other than that, 2008 version is good enough to practice most of the SQL Queries. Good luck!

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

    I use bulkinsert at work too. But it has its limitations. Sometimes I get pipe delimited CSV files where the column values are surrounded by double quotes. When we use bulk insert with such a file then the columns in table also get double quotes around it. Is there any solution to load the data without the double quotes?

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

    Thank you for the this video. I am struggling using the second option because my case is different. I want to be able to use a query for different files, I might not know the data contained in the csv since I am planning to automate it. Is there a way of creating a format file automatically??

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

      You might have to look for 3rd party tools to do that. I don’t have much knowledge on that. Else you will have to read all data as one single column and use the logic downstream to derive header names.

  • @KarthikH-cw3ug
    @KarthikH-cw3ug ปีที่แล้ว

    Msg 4860, Level 16, State 3, Line 1
    I am receiving this error Cannot bulk load. The file "C:\Test.fmt" does not exist or you don't have file access rights.

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

    Question:
    To laod data from CSV into SQL table, I had to declare all data type in SQL table as nvarchar.
    Is there any way to Load data from CSV to SQL table with different types ( eg: int, nvarchar(50), date...)
    without using MS Visual Studio SSIS ?

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

    Hi there!
    Ex: how to extract data, how to store data into multiple tables, and how to send data from staging server to data warehouse using store procedure, please explain 🙏🙏

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

      We will be covering stored procedure in one of our upcoming tutorials!

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

      @@LearnatKnowstar when it will be, please try explain really world scenarios i hope you will teach....

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

    It's not working in Oracle SQL Developer

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

      The methods explained are only for MS SQL Server.

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

    Bulk keyword unrecognized