Quote:
Originally Posted by Killsteal
Hi,
WebItemal u.s.w
|
Use Stored Proc's from PS_GMTool or create new..
example:
Code:
USE [PS_GMTool]
GO
/****** Object: StoredProcedure [dbo].[usp_Add_Gift] Script Date: 05/12/2010 00:35:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Twilight:********.com>
-- Create date: <05/12/2010 00:35:12>
-- Description: <For WebMall[Test]>
-- System: OS Win Server 2008, SQL 2008 Server
-- =============================================
ALTER PROCEDURE [dbo].[usp_Add_Gift]
-- Add the parameters for the stored procedure here
@UserUID int,
@Slot tinyint,
@ItemID int,
@ItemCount tinyint
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
DECLARE
@MaxCount int
SET @MaxCount = 0
SELECT @MaxCount = [Count] FROM PS_GameDefs.dbo.Items
WHERE ItemID = @ItemID
IF @MaxCount < @ItemCount
BEGIN
RAISERROR ('Item Max Count Error', 16, 1)
RETURN
END
DECLARE
@GameDB varchar(50),
@Table varchar(100),
@Sql nvarchar(2048)
SET @Table = 'PS_GameData.dbo.UserStoredPointItems '
SET @Sql =
'INSERT INTO ' + @Table + '(UserUID, Slot, ItemID, ItemCount, BuyDate) VALUES(' +
CONVERT( varchar(20), @UserUID) + ',' +
CONVERT( varchar(8), @Slot) + ',' +
CONVERT( varchar(20), @ItemID) + ',' +
CONVERT( varchar(8), @ItemCount) + ', GETDATE() )'
EXEC (@Sql)
SET NOCOUNT OFF
END
SQL Q:
Code:
use PS_GMTool;
--UserUID = 1
--Slot = 1
--ItemID = 1001
--ItemCount = 1
exec dbo.usp_Add_Gift 1,1,1001,1;
In Game use GiftBox !