Skip to content

Instantly share code, notes, and snippets.

@4sskick
Last active July 9, 2024 07:21
Show Gist options
  • Save 4sskick/72fb887830fe0e6debabcf54aadbf624 to your computer and use it in GitHub Desktop.
Save 4sskick/72fb887830fe0e6debabcf54aadbf624 to your computer and use it in GitHub Desktop.
import large file SQL
I have SQL file with size 16GB, but can't import directly using SQL server management tools.
So sqlcmd is the saviour!!
simply just run the command with following format
```
sqlcmd -S ‘your server name’ -U ‘user name of server’ -P ‘password of server’ -d ‘db name’-i ‘script.sql’ -a 32767
```
in may case would be
```
sqlcmd -S ID0199-PC -d RSPIData -i ‘script.sql’ -a 32767
```
I am not set the U and P becauseI use the windoes auth
but another option using another strategy like this one, https://dba.stackexchange.com/a/54460
p.s: I am not tested that one btw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment