• You'll want to read up on the sqlcmd.exe utility. If you are looking to do things through the command line, it's one method. Another would be to use PowerShell. You can call that through the invoke-sqlcmd commandlet.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning