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

Поделиться
HTML-код
  • Опубликовано: 24 июл 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.blogspot.com/2022/0...
    Microsoft documentation on OPENROWSET and BULK INSERT
    docs.microsoft.com/en-us/sql/...
    docs.microsoft.com/en-us/sql/...
    How to install SQL Server for practice?
    • How to install SQL Ser...
    Check out the complete list of SQL Query Interview Questions -
    • SQL Query Interview Qu...
    Best Data Science / Analytics / SQL courses
    Learn SQL Basics for Data Science Specialization
    imp.i384100.net/qnXYk5
    Beginners to Python Programming
    skillshare.eqcm.net/GjMakm
    Data Science and Business Analytics with Python
    skillshare.eqcm.net/JrM1Aq
    Get 40% OFF of Skillshare with code FLASH40 - October 2022
    skillshare.eqcm.net/c/3299742...
    Data Science Fundamentals with Python and SQL Specialization
    imp.i384100.net/mgVYre
    Python for Everybody Specialization
    imp.i384100.net/DVz7Aj
    Google Data Analytics Professional Certificate
    imp.i384100.net/OR37oQ
    Coursera Plus - Data Science Career Skills
    imp.i384100.net/c/3299742/132...
    Please do not forget to like, subscribe and share.
    For enrolling and enquiries, please contact us at
    Website - knowstar.org/
    Instagram - / learn.knowstar
    Facebook - / knowstartrainings
    Linkedin - www.linkedin.com/company/know...
    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.

  • @diydecor2653
    @diydecor2653 2 года назад

    Another great tutorial. Thanks!

  • @amukelaniebenezer406
    @amukelaniebenezer406 Год назад

    Gonna need this.

  • @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

  • @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?

  • @prateekkumar-xc6uo
    @prateekkumar-xc6uo 3 месяца назад

    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

  • @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.

  • @hv0032113
    @hv0032113 2 года назад

    Very helpful

  • @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.

  • @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 🙏

  • @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!

  • @vincentchidiebere1652
    @vincentchidiebere1652 Год назад +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 Год назад +1

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

    • @vincentchidiebere1652
      @vincentchidiebere1652 Год назад

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

  • @talarichennakesavulu4241
    @talarichennakesavulu4241 2 года назад

    It's usefull to all

  • @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 Год назад

    It's not working in Oracle SQL Developer

    • @saktibiswal6445
      @saktibiswal6445 Год назад

      The methods explained are only for MS SQL Server.

  • @tinatina7838
    @tinatina7838 3 месяца назад

    Bulk keyword unrecognized