I am trying to execute one stored procedure using 'sa' user through perl script
save this line in a perl file and execute that perl file
system("start /wait sqlcmd.exe -S serverName -U sa -P test@123 -d JSONdb -Q \"EXECUTE UPDATE_SP\" -o C:\\Temp\\log.txt");
=============================================================================
-S serverName :: sql server which i want to connect.
-U sa -P test@123 :: login user credentials
-d JSONdb :: database name.
\\"EXECUTE update_JSONTable\\" :: command to execute stored procedure [update_JSONTable]
-o C:\\Temp\\log.txt" :: saving logs
There are can be three reasons:
[JSONdb]
is not available Another reason can be related to special characters escaping. Your password contains @ , therefore this argument is to be also adjusted:
-P test@123 => -P test\@123
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.