Here is the code in my batch file
set startdate="9/1/2011"
set enddate="10/31/2011"
sqlcmd -Q "exec mysp '%startdate%', '%enddate%'"
I want to execute the command in SQL Server:
exec mysp '9/1/2011', '10/31/2011'
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, you haven’t exactly told us what’s going wrong but I’m guessing the double quotes arond the dates are being included in the command, as per:
Try removing them.