I have this query that I want to use as a stored procedure:

```
  SELECT ISNULL(P.firstname, s.firstname) AS Expr1,ISNULL(P.lastname,
  s.lastname) AS Expr2 FROM comment AS C LEFT OUTER JOIN professor AS P ON P.ID =   

  C.PID LEFT OUTER JOIN student AS s ON s.ID = C.SID

  WHERE (C.VID = @VID)

```

it should return values of Expr1 and Expr2

I've tried to declare inputs and outputs but with no luck

please help

EDIT :

```
  CREATE PROCEDURE [dbo].[GetDepartmentName]
  @ID int,
  @fName varchar(50) OUTPUT
   @lName varchar(50) OUTPUT
  AS

SELECT @fName=COALESCE(p.firstname, s.firstname)   @lName=COALESCE(p.lastname,     

   s.lastname)as 
  FROM comment c
  LEFT JOIN Professor p
    ON c.pid = p.id
  LEFT JOIN Student s
    ON c.sid = s.id
 WHERE c.vid = @ID

```