Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2006
    Posts
    82

    Unanswered: Newbie Stored Proc

    ok before you laugh, let me explain. I am running this Stored Proc because the program i need to use the update statement wont let me execute a simple update statement so i figured i would give it a shot and try to trick it by running the values into a stored procedure.

    here is a copy of the stored procedure

    Code:
    CREATE PROCEDURE sparCloseProject
    
    		(
    		@iProjectNo as VarChar
    		)
    
    
    
    
    
    
    
    
     AS
    
    
    
    UPDATE tPA00175 SET siJobStatus='4' Where chrJobNumber='@iProjectNo'
    
    
    
    
    GO
    yes it is just an update statement but when i debug it, it aborts with this message.

    [Microsoft][ODBC SQL Server Driver]String data, right truncation

    I am very new to stored procs and i was hoping someone could help me with this one. what am i doing wrong? i cant even really debug as it aborts before any actual debugging. thanks alot

    tibor

  2. #2
    Join Date
    Jun 2004
    Posts
    50
    You need to put the max size of your varchar. VARCHAR(20) for example.
    Monk
    The person who confesses ignorance shows it once; the person who conceals it shows it many times.

  3. #3
    Join Date
    Mar 2006
    Posts
    82
    I tried that earlier and still got the same message...

  4. #4
    Join Date
    Jan 2004
    Location
    Tacoma, Wa
    Posts
    15
    Remove the quotes from the variable

    CREATE PROCEDURE sparCloseProject

    (
    @iProjectNo as VarChar(20)
    )








    AS



    UPDATE tPA00175 SET siJobStatus='4' Where chrJobNumber=@iProjectNo

  5. #5
    Join Date
    Mar 2006
    Posts
    82
    ok cool that got it thanks

Posting Permissions

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