Exforsys
+ Reply to Thread
Results 1 to 2 of 2

Problem with stored procedure

This is a discussion on Problem with stored procedure within the SQL Server forums, part of the Database category; Hi, Im getting the following error when trying to execute the stored procudre. String or binary data would be truncated. ...

  1. #1
    NareshShroff is offline Junior Member Array
    Join Date
    Apr 2004
    Answers
    18

    Problem with stored procedure

    Hi,
    Im getting the following error when trying to execute the stored procudre.

    String or binary data would be truncated.
    The statement has been terminated.
    can anyone help me out.

    Stored procedure:
    CREATE PROCEDURE taskInsert
    (
    @taskid char(10),
    @task char(20),
    @type char(10),
    @createdate varchar(50),
    @createdby char(10),
    @notes varchar(500),
    @activedate varchar(50),
    @duedate varchar(50),
    @locid char(10),
    @completedate varchar(50),
    @closeddate varchar(50),
    @completedby char(10),
    @closedby char(10)
    )
    AS
    INSERT INTO Tasks VALUES
    (@taskid, @task, @type, @createdate, @createdby, @notes, @activedate, @duedate, @locid,
    @completedate, @closeddate, @completedby, @closedby)
    GO
    and the values that iam trying to insert
    Execute taskInsert \'OT-90\', \'open the door\', \'open\', \'5 oct 2004 1:40 PM\',
    \'nshroff\', \'regregerg\', \'\',\'\',\'Ucenter\',\'\',\'\',\'\',\'\'
    i think the problem is with null values. My table structure allows null values also but still cant able to figure it out.

    Thanks in advance

    Post edited by: NareshShroff, at: 2004/10/05 22:00

    Post edited by: NareshShroff, at: 2004/10/05 22:04


  2. #2
    ussainbasha is offline Junior Member Array
    Join Date
    Jul 2007
    Answers
    7
    hai naresh,
    i think the error can be producing from ur first line...
    first u i think the syntax is
    <create procedure databasename.procedurename.........>
    please try this like insha allah you get the right answer...


Latest Article

Network Security Risk Assessment and Measurement

Read More...