Execute stored procedure from batch file

后端 未结 3 1426
执笔经年
执笔经年 2021-02-07 10:54

How would you execute a stored procedure in SQL Server (using windows authentication) from a batch file?

3条回答
  •  孤街浪徒
    2021-02-07 11:30

    If you are using Sql Server 2005+, you can use sqlcmd utility.

    Example:

    sqlcmd -Q "exec storedProcName" -S YourServer -d YourDatabase -o C:\yourOutput.txt

提交回复
热议问题