Sometimes we need to run large sql script which has 1-10 gb size or something etc. then we won't be open this .sql file in sql, notepad, etc.
In this case, we need to run this command without any problem in easiest way, we can use commandline sqlcmd command to run our sql commands.
To do this operation, just follow few steps ;
- Click Windows + R
- type cmd and press enter to reach commandline
- use sqlcmd -S [servername] -d [databasename] -i [scriptfilename] command to run your file :)
Thats all.
In my scenario , I runned 8 GB .sql file with this method then it will completed successfuly without wasting memory or cpu while doing its job.
-
Running large .sql script via command line
Şubat 14, 2019 0
Running large .sql script via command lineYunus Emre Şubat 14, 2019
Yunus Emre
Integer sodales turpis id sapien bibendum, ac tempor quam dignissim. Mauris feugiat lobortis dignissim. Aliquam facilisis, velit sit amet sagittis laoreet, urna risus porta nisi, nec fringilla diam leo quis purus.