title: Msg 512, Level 16, State 1, Procedure test, Line 21 Subquery returned more than 1 value
body: <pre><code>ALTER PROCEDURE [dbo].[test]
  @tour int,
  @tourname varchar(50) OUTPUT,  
  @tourdepartures varchar(50) OUTPUT
  AS
  BEGIN
   -- SET NOCOUNT ON added to prevent extra result sets from
   -- interfering with SELECT statements.
   SET NOCOUNT ON;
  
      -- Insert statements for procedure here
  SET @tourname = (select [tour name] from dbo.products1 where tour = @tour)
  
  SET @tourdepartures = (select ddate7 from dbo.TDEPART1 where tour = @tour and depart &gt; convert(int,getdate()))
  
  END
  </code></pre>
  
  <p>I want to use a stored procedure to populate a label on my asp.net page
  and a dropdownlist</p>
  
  <p>@tourname will be populated into a single label</p>
  
  <p>while @tourdepartures will be multiple dates, that i want in a dropdownlist</p>
  
  <p>however when i run my sp i get this error </p>
  
  <pre><code>Msg 512, Level 16, State 1, Procedure test, Line 21
  Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &lt;, &lt;= , &gt;, &gt;= or when the subquery is used as an expression.
  
  (1 row(s) affected)
  
  (1 row(s) affected)
  </code></pre>
  
  <p>and it works when i do</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[test]
  @tour int,
  @tourname varchar(50) OUTPUT,  
  @tourdepartures varchar(50) OUTPUT
  AS
  BEGIN
   -- SET NOCOUNT ON added to prevent extra result sets from
   -- interfering with SELECT statements.
   SET NOCOUNT ON;
  
      -- Insert statements for procedure here
  SET @tourname = (select [tour name] from dbo.product where tour = @tour)
  
  SET @tourdepartures = (select top 1 ddate7 from abcfilestest.dbo.TDEPART where tour = @tour and depart &gt; convert(int,getdate()))
  
  END
  </code></pre>
  
  <p>but it only gives me the first departure date</p>