post icon

Exec SQL Statement file by Prompt Command

Spesso è molto utile eseguire un comando SQL da file, soprattutto se è molto grande e le dimensioni non consentono di aprire il file con l’editor SQL Server Management Studio.

Ecco un esempio di utilizzo:

SQLCMD -E -d db -i input.sql -o output.txt

Di seguito, invece, la guida completa per l’utilizzo di tutti i parametri:

usage: Sqlcmd [-U login id] [-P password] [-S server] [-H hostname] [-E trusted connection] [-d use database name] [-l login timeout] [-t query timeout] [-h headers] [-s colseparator] [-w screen width] [-a packetsize] [-e echo input] [-I Enable Quoted Identifiers] [-c cmdend] [-L list servers[clean output]] [-q "cmdline query"] [-Q "cmdline query" and exit] [-m errorlevel] [-V severitylevel] [-W remove trailing spaces] [-u unicode output] [-r[0|1] msgs to stderr] [-i inputfile] [-o outputfile] [-z new password] [-f <codepage> | i:<codepage>[,o:<codepage>]] [-Z new password and exit] [-k[1|2] remove[replace] control characters] [-y variable length type display width] [-Y fixed length type display width] [-p[1] print statistics[colon format]] [-R use client regional setting] [-b On error batch abort] [-v var = "value"...] [-A dedicated admin connection] [-X[1] disable commands, startup script, enviroment variables [and exit]] [-x disable variable substitution]
31 maggio 2009 @ 09:15

1 Comment

Leave a comment
  1. Katia
    18 agosto 2014 at 21:30 #

    Amazing! Its actually awesome article, I have got much clear idea concerning from this post.

Leave a Reply

Are you human? Time limit is exhausted. Please reload CAPTCHA.