05-07-2008, 04:52 PM
Я не телепат информацию в студию:
1 Конфигурация сервера
2 Операционная система
3 Скриншоты ошибок
Для начала хватит.
Корекция базы для сохранения агументации:
1 Конфигурация сервера
2 Операционная система
3 Скриншоты ошибок
Для начала хватит.
Корекция базы для сохранения агументации:
Код:
ALTER TABLE user_item ADD
effects int NOT NULL DEFAULT 0,
skill int NOT NULL DEFAULT 0,
skill_level int NOT NULL DEFAULT 0;
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[lin_LoadItems]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[lin_LoadItems]
GO
CREATE PROCEDURE [DBO].[lin_LoadItems]
(
@char_id INT,
@warehouse INT
)
AS
SET NOCOUNT ON
DECLARE @nSum INT
DECLARE @nCount INT
SET @nSum = 0
SET @nCount = 0
--SELECT @nCount = count(amount), @nSum = sum(amount) FROM user_item WHERE char_id = @char_id AND item_type = 57 AND warehouse = @warehouse
--IF @nCount > 1
--BEGIN
-- DECLARE @nMaxItemId INT
-- SELECT @nMaxItemId = Max(item_id) FROM user_item WHERE char_id = @char_id AND item_type = 57 AND warehouse = @warehouse
-- IF @nMaxItemId > 0
-- BEGIN
-- UPDATE user_item Set amount = @nSum WHERE char_id = @char_id AND item_type = 57 AND warehouse = @warehouse And item_id = @nMaxItemId
-- DELETE user_item WHERE char_id = @char_id AND item_type = 57 AND warehouse = @warehouse And NOT item_id = @nMaxItemId
-- END
--END
SELECT item_id, item_type, amount, enchant, eroded, bless, ident, wished, effects, skill, skill_level FROM user_item (nolock) WHERE char_id = @char_id AND warehouse = @warehouse AND item_type > 0
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[lin_LoadItemByItemId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[lin_LoadItemByItemId]
GO
CREATE PROCEDURE [DBO].[lin_LoadItemByItemId]
(
@item_id INT
)
AS
SET NOCOUNT ON
SELECT char_id, item_type, amount, enchant, eroded, bless, ident, wished, warehouse, effects, skill, skill_level FROM user_item (nolock) WHERE item_id = @item_id AND (NOT item_type = 0)
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[lin_SaveAugmentation]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[lin_SaveAugmentation]
GO
CREATE PROCEDURE [dbo].[lin_SaveAugmentation]
(
@item_id INT,
@effects INT,
@skill INT,
@skill_level INT
)
AS
SET NOCOUNT ON
UPDATE user_item SET effects = @effects, skill = @skill, skill_level = @skill_level WHERE item_id = @item_id
GO