Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2003
    Location
    Bogotá, Colombia
    Posts
    11

    Unanswered: Varchar size in stored procedure

    Hi,

    mi procedure is something like this:

    CREATE PROCEDURE SP_UPDATE_WEBSITE
    @name_w VARCHAR(255),
    @description_w VARCHAR(255),
    @pkId int
    AS
    UPDATE CM_WEBSITES
    SET NAME = @name_w,
    DESCRIPTION = @description_w
    WHERE ID = @pkId
    GO

    if I insert a string less than 255 chars, the procedure fills the string with blank spaces.

    What should i do?

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    Check table CM_WEBSITES - is it char or varchar fields?

  3. #3
    Join Date
    Jul 2003
    Location
    Bogotá, Colombia
    Posts
    11

    Varchar size in stored procedure

    Hi,

    it is varchar(255)

    thanx

    Originally posted by snail
    Check table CM_WEBSITES - is it char or varchar fields?

  4. #4
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    Try to use simple update or insert for table and check result - may be SP is not a problem...

  5. #5
    Join Date
    Jul 2003
    Location
    Penang, Malaysia
    Posts
    212
    Just a though
    Maybe your client side variable is not trimed?

    if your doing it in ASP, have you done trim(variable) b4 passing it to your SP ?
    Patrick Chua
    LBMS ( Learn By My Self) NPQ ( No paper Qualification )

Posting Permissions

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