Register for your free account! | Forgot your password?

You last visited: Today at 05:07

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Need some help

Discussion on Need some help within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2011
Posts: 19
Received Thanks: 0
Need some help

When i run a Query to add items in npc i got this error

Msg 544, Level 16, State 1, Line 48
Cannot insert explicit value for identity column in table '_RefPackageItem' when IDENTITY_INSERT is set to OFF.

Msg 544, Level 16, State 1, Line 70
Cannot insert explicit value for identity column in table '_RefScrapOfPackageItem' when IDENTITY_INSERT is set to OFF.


any help pls

thank you
maskmoataz is offline  
Old 11/21/2012, 16:10   #2



 
elite*gold: 0
The Black Market: 264/0/0
Join Date: Jul 2012
Posts: 24,494
Received Thanks: 3,215
Can you Copy the sysser and Querry?
Sintiax is offline  
Old 11/21/2012, 17:25   #3
 
elite*gold: 0
Join Date: Nov 2011
Posts: 19
Received Thanks: 0
This is the Query i used


Code:
USE LN_GAME
GO
DECLARE @ID int
DECLARE @INDEX int
DECLARE @CodeName varchar(129)
DECLARE @DescSTRID varchar(129)
DECLARE @File varchar(129)
DECLARE @Price int
DECLARE @SilkPrice int
DECLARE @Slot tinyint
DECLARE @TAB varchar(129)
DECLARE @Data int
DECLARE @ShopGoodsOnly int
--- Set Variables
SET @CodeName = 'ITEM_EU_SWORD_10_A_RARE'
SET @Price = 5000000
SET @SilkPrice = 0
SET @TAB = 'STORE_KT_SMITH_EU_TAB1'
SET @ShopGoodsOnly = 0
--- do not edit
SELECT TOP 1 @ID = ID FROM _RefPackageItem ORDER BY ID DESC
SET @ID = @ID + 1
SELECT TOP 1 @INDEX = [Index] FROM _RefScrapOfPackageItem ORDER BY [Index] DESC
SET @INDEX = @INDEX + 1
SELECT TOP 1 @Slot = SlotIndex FROM _RefShopGoods WHERE RefTabCodeName = @TAB ORDER BY SlotIndex DESC
IF (@Slot = 0)
BEGIN
	SET @Slot = @Slot + 1
END
ELSE IF (@Slot > 0)
BEGIN
	SET @Slot = @Slot + 1
END
ELSE
BEGIN
	SET @Slot = 0
END
SET @DescSTRID = 'SN_' + @CodeName + '_TT_DESC'
SELECT @File = AssocFileIcon128 FROM _RefObjCommon WHERE CodeName128 = @CodeName
IF (@CodeName LIKE '%RING%' OR @CodeName LIKE '%NECKLACE%' OR @CodeName LIKE '%ARCHEMY%')
BEGIN
	SET @Data = 1
END
ELSE
BEGIN
	SELECT @Data = Dur_U FROM _RefObjItem WHERE ID = (SELECT Link FROM _RefObjCommon WHERE CodeName128 = @CodeName)
END
IF (@ShopGoodsOnly = 0)
BEGIN
INSERT _RefPackageItem 
(
[Service],
Country,
ID,
CodeName128,
SaleTag,
ExpandTerm,
NameStrID,
DescStrID,
AssocFileIcon,
Param1,
Param1_Desc128,
Param2,
Param2_Desc128,
Param3,
Param3_Desc128,
Param4,
Param4_Desc128) 

VALUES 
( 1, 15, @ID,'PACKAGE_' + @CodeName, 0, 'EXPAND_TERM_ALL', 'SN_' + @CodeName, @DescSTRID, @File, -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx')
INSERT _RefScrapOfPackageItem 
(
Service,
Country,
RefPackageItemCodeName,
RefItemCodeName,
OptLevel,
Variance,
Data,
MagParamNum,
MagParam1,
MagParam2,
MagParam3,
MagParam4,
MagParam5,
MagParam6,
MagParam7,
MagParam8,
MagParam9,
MagParam10,
MagParam11,
MagParam12,
Param1,
Param1_Desc128,
Param2,
Param2_Desc128,
Param3,
Param3_Desc128,
Param4,
Param4_Desc128,
[Index]
) 

VALUES 
(1, 15, 'PACKAGE_' + @CodeName, @CodeName, 0, 0,    @Data,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    -1,    'xxx',    -1,    'xxx',    -1,    'xxx',    -1,    'xxx',    @INDEX )
IF (@Price > 0)
BEGIN
INSERT _RefPricePolicyOfItem 
(
Service,
Country,
RefPackageItemCodeName,
PaymentDevice,
PreviousCost,
Cost,
Param1,
Param1_Desc128,
Param2,
Param2_Desc128,
Param3,
Param3_Desc128,
Param4,
Param4_Desc128
) 

VALUES 
(1,    15,    'PACKAGE_' + @CodeName,    1,    0,    @Price,    -1,    'xxx',    -1,    'xxx',    -1,    'xxx',    -1,    'xxx')
END
IF (@SilkPrice > 0)
BEGIN
INSERT _RefPricePolicyOfItem 
(
Service,
Country,
RefPackageItemCodeName,
PaymentDevice,
PreviousCost,
Cost,
Param1,
Param1_Desc128,
Param2,
Param2_Desc128,
Param3,
Param3_Desc128,
Param4,
Param4_Desc128
) 

VALUES 
(1,    15,    'PACKAGE_' + @CodeName,    2,    0,    @SilkPrice,    -1,    'xxx',    -1,    'xxx',    -1,    'xxx',    -1,    'xxx')
END

INSERT _RefShopGoods
(
Service,
Country,
RefTabCodeName,
RefPackageItemCodeName,
SlotIndex,
Param1,
Param1_Desc128,
Param2,
Param2_Desc128,
Param3,
Param3_Desc128,
Param4,
Param4_Desc128
) 

VALUES 
(1,    15,    @TAB,'PACKAGE_' + @CodeName, @Slot,    -1,    'xxx',    -1,    'xxx',    -1,    'xxx',    -1,    'xxx')  
END
ELSE IF (@ShopGoodsOnly = 1)
BEGIN
INSERT _RefShopGoods
(
Service,
Country,
RefTabCodeName,
RefPackageItemCodeName,
SlotIndex,
Param1,
Param1_Desc128,
Param2,
Param2_Desc128,
Param3,
Param3_Desc128,
Param4,
Param4_Desc128
) 

VALUES 
(1,    15,    @TAB,'PACKAGE_' + @CodeName, @Slot,    -1,    'xxx',    -1,    'xxx',    -1,    'xxx',    -1,    'xxx')  
print @CodeName
END
when i run it i got this message :

Code:
Msg 544, Level 16, State 1, Line 48
Cannot insert explicit value for identity column in table '_RefPackageItem' when IDENTITY_INSERT is set to OFF.

Msg 544, Level 16, State 1, Line 70
Cannot insert explicit value for identity column in table '_RefScrapOfPackageItem' when IDENTITY_INSERT is set to OFF.

(1 row(s) affected)

(1 row(s) affected)
Any one Please answer me
maskmoataz is offline  
Reply




All times are GMT +2. The time now is 05:07.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.