How to run .sql files (more than 8GB) in SQL SERVER 2018 ?

Emmanuel Raju Veramati 1 Reputation point
2021-06-29T14:04:12.12+00:00

Hi I am new to SQL SERVER , I used to run .sql file that is having insert statements (Size 8GB) and tried to run on SQLCMD and having syntax issues.. Kindly help me to come out from it

Tried to run below command from SQLCMD but getting syntax errors:
sqlcmd -S DESKTOP-05PQF4Q -d B2BLeadforce -i F:\Spondias\B2B_Callcenterproject\B2B Database\TransactionType -a 32767

Msg 102, Level 15, State 1, Server DESKTOP-05PQF4Q, Line 1
Incorrect syntax near 'S'.

How to run large sql file in sql server 2018..

Kindly help me

SQL Server | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 121.8K Reputation points MVP Volunteer Moderator
    2021-06-29T19:53:04.753+00:00

    The problem seem familiar. I think I've seen people to run into this before. I don't have any 8GB file myself to try with.

    I know that it is common in the MySQL world with exporting data as INSERT files, but that is not really what we do in the SQL Server world.

    I think you will have to cut the file into several files, but I don't know what size you will need to keep SQLCMD from choking. You will have to experiment.

    0 comments No comments

  2. CarrinWu-MSFT 6,891 Reputation points
    2021-06-30T02:29:04.18+00:00

    Hi @Emmanuel Raju Veramati ,

    Welcome to Microsoft Q&A!

    You could try to add -o that can output a file to help you debug them. Please refer to this thread.

    Best regards,
    Carrin


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.