title: SQL - Stored Procedures - get values from subquery
body: <p>I have a stored procedure and <code>EXEC</code> call like:</p>
  <pre><code>EXEC Schedule_InsertReservations 
       @ScheduleID = (SELECT ScheduleID FROM Schedule WHERE Job_No = 'ABC'),
       @ScheduleTaskID = (SELECT ScheduleTaskID FROM ScheduleTasks WHERE (ScheduleID = (SELECT ScheduleID FROM Schedule WHERE Job_No = 'ABC')) AND LibraryTaskID = 247),
       @ResourceID = (SELECT Vendor_ID FROM tblVendors WHERE Vendor_Name = 'Blue Line Taxi')
  </code></pre>
  <p>and I am trying to set the values for the stored procedure using sub-queries but I get these errors when I run it:</p>
  <blockquote>
  <p>Msg 102, Level 15, State 1, Line 1<br />
  Incorrect syntax near '('.</p>
  <p>Msg 102, Level 15, State 1, Line 1<br />
  Incorrect syntax near ','.</p>
  <p>Msg 102, Level 15, State 1, Line 1<br />
  Incorrect syntax near ','.</p>
  </blockquote>
  <p>Can I not use sub-queries in stored procedures?</p>