How can I execute a set of .SQL files from within SSMS?

前端 未结 2 861
难免孤独
难免孤独 2021-02-01 12:28

How could I execute a set of .SQL files (each does some data transformations) from within SQL Server Management Studio?

What other alternative are there for executing .

2条回答
  •  感动是毒
    2021-02-01 12:53

    Use SqlCmd.exe.

    For example:

    sqlcmd -S myServer\instanceName -i C:\myScript.sql
    

    or to save output to a file:

    sqlcmd -S myServer\instanceName -i C:\myScript.sql -o C:\EmpAdds.txt
    

提交回复
热议问题