'Operand type clash: uniqueidentifier is incompatible with int'

  • Hi chaps, ripping my hair out with one.

    I'm using a stored procedure to dump some data into a sql 2008 db. The sp calls a couple of other sp's and it is one of these that is throwing the error 'Operand type clash: uniqueidentifier is incompatible with int'

    I've stepped through the sp in enterprised studio and entered the values mannually and the last table updates as desired. I've also stepped through the aspx page and all values are passed in ok.

    Any help would be appreciated as I am new to this.

    @refKey varchar(50),

    @disc int,

    @reEmp int,

    @qual int,

    @quat int,

    @app int,

    @rel int,

    @att int,

    @pun int,

    @abi int,

    @hon int,

    @initi int,

    @resp int,

    @reco int

    AS

    DECLARE @ppSettingsID int

    SET @ppSettingsID = (SELECT ppSettingsID FROM refs WHERE refKey=@refKey)

    DECLARE @aa int

    SET @aa = (SELECT qualPref FROM ppSettings WHERE ppSettingsID=@ppSettingsID)

    DECLARE @bb int

    SET @bb = (SELECT quatPref FROM ppSettings WHERE ppSettingsID=@ppSettingsID)

    DECLARE @cc int

    SET @cc = (SELECT appPref FROM ppSettings WHERE ppSettingsID=@ppSettingsID)

    DECLARE @dd int

    SET @dd = (SELECT relPref FROM ppSettings WHERE ppSettingsID=@ppSettingsID)

    DECLARE @ee int

    SET @ee = (SELECT attPref FROM ppSettings WHERE ppSettingsID=@ppSettingsID)

    DECLARE @ff int

    SET @ff = (SELECT punPref FROM ppSettings WHERE ppSettingsID=@ppSettingsID)

    DECLARE @gg int

    SET @gg = (SELECT abilPref FROM ppSettings WHERE ppSettingsID=@ppSettingsID)

    DECLARE @hh int

    SET @hh = (SELECT honPref FROM ppSettings WHERE ppSettingsID=@ppSettingsID)

    DECLARE @jj int

    SET @jj = (SELECT initiPref FROM ppSettings WHERE ppSettingsID=@ppSettingsID)

    DECLARE @kk int

    SET @kk = (SELECT respPref FROM ppSettings WHERE ppSettingsID=@ppSettingsID)

    DECLARE @ll int

    SET @ll = (SELECT reemPref FROM ppSettings WHERE ppSettingsID=@ppSettingsID)

    DECLARE @mm int

    SET @mm = (SELECT recPref FROM ppSettings WHERE ppSettingsID=@ppSettingsID)

    DECLARE @nn int

    SET @nn = (SELECT subjPref FROM ppSettings WHERE ppSettingsID=@ppSettingsID)

    DECLARE @PPPass bit

    IF (@disc >= @nn)

    BEGIN

    IF (@reco >= @mm)

    BEGIN

    IF (@reEmp >= @ll)

    BEGIN

    IF (@resp >= @kk)

    BEGIN

    IF (@initi >= @jj)

    BEGIN

    IF (@hon >= @hh)

    BEGIN

    IF (@abi >= @gg)

    BEGIN

    IF(@pun >= @ff)

    BEGIN

    IF (@att >= @ee)

    BEGIN

    IF (@rel >= @dd)

    BEGIN

    IF (@app >= @cc)

    BEGIN

    IF (@quat >= @bb)

    BEGIN

    IF (@qual >= @aa)

    BEGIN

    SET @PPPass='true'

    END

    END

    END

    END

    END

    END

    END

    END

    END

    END

    END

    END

    END

    ELSE

    BEGIN

    SET @PPPass='false'

    END

    UPDATE refs

    SET PPPass=@PPPass

    WHERE refKey=@refKey

  • Please post definitions of all affected tables. Is there a line number listed for that error?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • uniqueidentifier does not implicitly convert to int, you will need to use convert or cast.

    http://msdn.microsoft.com/en-us/library/aa226054(v=SQL.80).aspx

    ---------------------------------------------------------------------

  • I am not very much stronger in db but i think it would be parent/child relationship value. if you have any foreign key constraint for child table then this would be conflicted any where..

    so please check you fk and pk relationship value.

    then if you have problem then plz give me all the scenerio.

    Thanks and Regards,

    Praveen Srivastava

    SSE

  • Please note: year-old thread.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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