db library dead !!!!

  • Dear Friends

    I got an error while running a stored procedure it was like connection broken ,db library dead.But sql server recovers soon .

    After examining the procedure with geat difficulty I found out that its because of a conditional statement .

    
    

    if (select sum(plant_per) from tbl_palnts_share where plant=’plant1’ ) not between 0.9 and 1.1
    begin
    raiserror(“……………..”)
    return
    end

    This procedure was quite ok and was running for last many yrs with out any problem in 6.5 version of the SQL server ,now in 2000

  • Can you post the actual RAISERROR statement?


    Cheers,
    - Mark

  • raiserror('Invalid Plant Allocation',16,2 )

    the system failes in the the ,conditional statement not in the raiserror()

    Will one cast in the in if () will solve the problem ,

    Problem is serious enough ,because the user is trying some ten times system will hang

    I solve it through

    
    
    declare @sumPer
    select @sumPer=(sum() from ....
    if (@sumPer not between .09 and 1.0 )
    begin

    end

    But my problem is,I frequently used to use such statements ,and every where I have to change it seems ......

  • What datatype is the column "plant_per"? That would be the first thing I'd look at with a 6.5 to 2000 conversion.

    Look at BOL for an example of problems like this, keyword "decimal data type, compatibility issues":

    Signature is NULL

  • numeric(5,2)

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply