Bulk insert data from .csv or .xls on a remote database

  • Hello,

    I have a SQLServer database on a web server and would like to INSERT data from a .csv or .xls file. I just learned about the BULK INSERT command and have tested it on a local database but how do I get it to work with a remote database that I have no admin rights to?

    Is it possible to use a URL in the FROM clause of the BULK INSERT command?

    Or if this is not possible, how else can I bulk upload data to a remote database?

    Thanks

  • ahmet erispaha (6/15/2010)


    Hello,

    I have a SQLServer database on a web server and would like to INSERT data from a .csv or .xls file. I just learned about the BULK INSERT command and have tested it on a local database but how do I get it to work with a remote database that I have no admin rights to?

    Is it possible to use a URL in the FROM clause of the BULK INSERT command?

    Or if this is not possible, how else can I bulk upload data to a remote database?

    Thanks

    URL: No. UNC: Probably (I'd have to test, but I believe you can do this, as long as you have read access on the remote server to the directory that the file is located in.)

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • I tried to get a UNC that I can use to point to a csv file on the root of my website but my webhost said I cannot do that 🙁

    They suggested I do the bulk upload on a local copy then provide a .bak file that they can then apply to my database on their server.

    Sounds like it's my only option in this case.

    Thanks for your suggestion.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply