sql - get .BAT file or SQLCMD to prompt user for input -



sql - get .BAT file or SQLCMD to prompt user for input -

i attempting run next query

sqlcmd -stemp7 -e -devolive_base -w256 -qexit("declare @r int exec @r = usp_addtoobservationtbl $,$,$ select @r")

i attempting bat file inquire user 3 variables.... can help me ?

you can utilize set /p variables:

set /p var1=enter variable 1 set /p var2=enter variable 2 set /p var3=enter variable 3

...then utilize them in command line:

sqlcmd -stemp7 -e -devolive_base -w256 -qexit("declare @r int exec @r = usp_addtoobservationtbl %var1%,%var2%,%var3% select @r")

bear in mind still leaves open sql injection attacks or entering destructive.

sql sql-server-2008 batch-file sqlcmd

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

ms access - C# - Using OleDbParameter on table name -