locked
I am using northwind database and have prob in exe. SP,, please tell me what i am missing/mistaking RRS feed

  • Question

  • Please help->

    SP definition:::
    CREATE proc [dbo].[getEmployee_sp_out]...
    @employeeID int,
    @employeeName varchar(200)='rajat' output
    as
    Begin
    select @employeeName= FirstName from Northwind..employees where EmployeeID=@employeeID
    return @employeeName
    End
    GO

    execution:::
    Declare @employeeID as int 
    Declare @employeeName as nvarchar(200)   
    Execute [getEmployee_sp_out] 1 , @employeeName output
    select @employeeName 

    Error msz:::
    Msg 245, Level 16, State 1, Procedure getEmployee_sp_out, Line 7
    Conversion failed when converting the varchar value 'Nancy' to data type int.
    Thursday, December 26, 2013 4:59 PM

Answers