- Joined
- Apr 16, 2007
- Messages
- 266
- Reaction score
- 61
I know this is pretty simple or already used, but for new owners, this may be useful.
What this does is lets you easily in other stored procedures or in engine, add items to a user, just using the minimal colums in the Item table.
USE [kal_db]
GO
/****** Object: StoredProcedure [dbo].[AddItem] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[AddItem]
--Declare parameters
Player_id int,
Index_id int,
Quantity int
AS
BEGIN
--Declare variables
Declare @item_id int
--step 1. Get Item IID Max for this current user
select @item_id = max(IID)
from [dbo].[Player]
where PID = Player_id
--step 2. add item for this user
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num])
VALUES ( Player_id, @item_id, Index_id, 0, 0, Quantity)
END
What this does is lets you easily in other stored procedures or in engine, add items to a user, just using the minimal colums in the Item table.
USE [kal_db]
GO
/****** Object: StoredProcedure [dbo].[AddItem] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[AddItem]
--Declare parameters
Player_id int,
Index_id int,
Quantity int
AS
BEGIN
--Declare variables
Declare @item_id int
--step 1. Get Item IID Max for this current user
select @item_id = max(IID)
from [dbo].[Player]
where PID = Player_id
--step 2. add item for this user
INSERT INTO Item ( [PID], [IID], [Index], [Prefix], [Info], [Num])
VALUES ( Player_id, @item_id, Index_id, 0, 0, Quantity)
END