so all works as far as i can feel it now
but i have a wired error shows if i tried to add another item ( the error cased by the Identity in _RefPackageitem)
my codes
Code:
if not exists ( select ID from _RefPackageItem where ID = 1 ) SET @ID = '1' if exists ( select ID from _RefPackageItem where ID = 1 ) SET @ID = (SELECT TOP 1 ID FROM _RefObjCommon ORDER BY ID DESC )+1
but if i tried to add 2nd item it works fine but with a hecka high ID ! =
but if i tried to add the 3rd item i get this error !
so i wonder which part made this error ?
----------------------Edit
already solved
Code:
if not exists ( select ID from _RefPackageItem where ID = 1 ) SET @ID = '1' if exists ( select ID from _RefPackageItem where ID = 1 ) SET @ID = (SELECT TOP 1 ID FROM [B][COLOR="DarkRed"][COLOR="Red"]_RefObjCommon[/COLOR][/COLOR][/B] ORDER BY ID DESC )+1






