December 4, 2014 at 7:20 pm
I've been executing the SQL script in sqlcmd and it has more arguments.
Is there any possibility to declare some of the arguments as optional, If user fails to enter value for any of the arguments then it displays the following message.
**
'inputvar1' scripting variable not defined
'inputvar2' scripting variable not defined
'inputvar3' scripting variable not defined
**
And, the following statement get printed along with above message
Changed database context to 'testdb'
I need to remove these messages while getting printed in output file.
Please help me on t
December 5, 2014 at 10:13 am
Can anyone help me on this?
December 5, 2014 at 10:37 am
are you explicitly defining the variables by using the :Setvar command?
Gerald Britton, Pluralsight courses
December 5, 2014 at 5:12 pm
No, I'm just passing arguments by using -v inputvar1="abc" inputvar2="xyz".
Here, user may pass argument called "inputvar3". If user fails to enter "inputvar3" then it's printing the message like 'inputvar3' scripting variable not defined
I don't want to print the message like if fails to pass arguments "inputvar3"
May 18, 2020 at 3:18 pm
I know I'm coming along late on this thread, but you can use the following:
SQLCMD -S YourServer -E -d YourDatabase -i YourScript 2> nul
That will send the StdErrorOut to the bit bucket.
May 23, 2020 at 6:42 pm
I know I'm coming along late on this thread, but you can use the following:
SQLCMD -S YourServer -E -d YourDatabase -i YourScript 2> nul
That will send the StdErrorOut to the bit bucket.
I am facing the similar issue and i will follow the mentioned instructions and update you here. Thank you for your help
Product Reviews: https://www.reviewsed.com/
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply