如何将 SQLCMD 代码保存为可执行文件 [英] How to save a SQLCMD code as a executable file

查看:37
本文介绍了如何将 SQLCMD 代码保存为可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组 SQLCMD 代码,它们将被保存为 exe 文件,以便人们可以只执行该文件,而不是复制粘贴代码并在命令行中运行命令.

I have a set of SQLCMD codes which are to be saved as exe files so that people can just execute the file rather than copy paste the code and run the command in command line.

推荐答案

将您的 sql 代码写入文件,例如 script.sql,然后使用以下命令创建批处理文件(例如 run.bat)

Write your sql code to file for example script.sql and than create a batch file (for example run.bat) with below command

sqlcmd -U user -P passwrod -S SerwerName -i C:\script.sql

这篇关于如何将 SQLCMD 代码保存为可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆