Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Location
    chennai
    Posts
    25

    Unanswered: how to execute SP

    hi all,

    i am having stored procedure like the below one:


    create procedure pro_emplname
    @name varchar
    as
    select * from employee where ename=@name

    i have tried like this to execute:

    exec pro_emplname kamal

    but i am not getting the output....
    could any one tell.....

    thanks
    Sakthi

  2. #2
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    varchar is a precision based datatype
    if you dont provide a datatype it's length will be 1 or = to one character.

    rewrite your code to read

    create procedure pro_emplname
    @name varchar(35)
    as
    select * from employee where ename=@name

    make sure that the length is equal to the greatest value in the ename col.


    [BOL] "Char and Varchar"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •