Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

i am trying to set up a sql server comnection in jenkins and then run a automate

ID: 3866142 • Letter: I

Question

i am trying to set up a sql server comnection in jenkins and then run a automated query. i did some research online and found that i should run this script in "windows execute batch command" build...but the connection and query failed. below is the script. am i using the wrong build or is the script wrong? in another article i read that i should use "execute shell" build, but i dont know what script to run for that. NOTE: im new to jenkins.

SQLCMD -S <SQLServerDBName> -U <SQLServerUsername> -P <SQLServerPassword> -W -Q "SELECT * from <SQLServerQueryHere>" > c:deleteoutput.xlsx -h-1 -s,

Explanation / Answer

SELECT servername AS 'Server Name' ,servicename AS 'Instance Name' ,DB_NAME() AS 'Database Name' from table_name;