SQLCMD: Prompt for Variable?

时间秒杀一切 提交于 2019-12-02 05:47:18
Florian Reischl

SQLCMD does not support prompting for missing variable names. However, you can use SSMS in SQLCMD mode. Dunno how you're error was caused, but this works for me:

:setvar table "sys.tables"

SELECT * FROM $(table);

There is a free tool "SQLS*Plus" which is an SQL*Plus for SQL Server. Works with SQL Server 2000/2005 and 2008

Very flexible with data formatting (set lines size, pagesize, etc), variables (&, &&), spool, etc - light years better than isql, osql or sqlcmd

I downloaded SQLS*Plus from http://www.memfix.com

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!