Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

hmm

Newbie Spellweaver
Joined
Jan 15, 2007
Messages
96
Reaction score
0
Parse this
Code:
/****** Object:  Table [dbo].[Clans]    Script Date: 01/05/2007 15:36:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Clans](
	[CLID] [int] IDENTITY(1,1) NOT NULL,
	[Level] [int] NOT NULL,
	[Name] [char](15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[ClanMaster] [INT] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[EmblemURL] [nchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[TotalPoint] [int] NOT NULL,
	[Point] [int] NOT NULL,
	[Wins] [int] NOT NULL,
	[Losses] [int] NOT NULL,
	[MemberCount] [int] NOT NULL,
	[Ranking] [int] NOT NULL,
	[EmblemChecksum] [nchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF


/****** Object:  StoredProcedure [dbo].[spAddClanMember]    Script Date: 01/05/2007 15:36:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[spAddClanMember] 
	@nCLID INT,
	@nCID INT,
	@nLEVEL INT
AS
	UPDATE Character SET CLID = @nCLID WHERE CID = @nCID
	UPDATE Character SET ClanGrade = @nLEVEL WHERE CID = @nCID
	
	DECLARE @nV INT
	DECLARE @nCNAME CHAR(15)
	SELECT @nCNAME = Name From Clans WHERE CLID = @nCLID
	UPDATE Character SET ClanName = @nCNAME Where CID = @nCID
	SELECT @nV = MemberCount From Clans WHERE CLID = @nCLID
	UPDATE Clans SET MemberCount = @nV + 1 WHERE CLID = @nCLID


/****** Object:  StoredProcedure [dbo].[spCreateClan]    Script Date: 01/05/2007 15:36:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[spCreateClan]
	@nClanName INT,
	@nMaster INT,
	@nUser1 INT,
	@nUser2 INT,
	@nUser3 INT,
	@nUser4 INT
AS
	--DECLARE @nCount INT
	--SELECT @nCount = COUNT(*) FROM Clans should work
	DECLARE @nNameofMaster varchar(10)
	SELECT @nNameofMaster = Name FROM Character WHERE CID = @nMaster
	INSERT INTO Clans
	VALUES(0,@nClanName,@nNameofMaster,NULL,0,0,0,0,5,0,NULL)
	UPDATE Character SET ClanName = @nClanName WHERE CID = @nMaster OR CID = @nUser1 OR CID = @nUser2 OR CID = @nUser3 OR CID = @nUser4
	DECLARE @nV INT
	SELECT @nV = CLID FROM Clans WHERE Name = @nClanName
	UPDATE Character SET CLID = @nV 
	WHERE CID = @nMaster OR CID = @nUser1 OR CID = @nUser2 OR CID = @nUser3 OR CID = @nUser4
	
	UPDATE Character SET ClanGrade = 1 WHERE CID = @nMaster
BEGIN
	SET NOCOUNT ON;

	SELECT CLID
	FROM Clans
	WHERE Name = @nClanName
END




/****** Object:  StoredProcedure [dbo].[spGetCharClan]    Script Date: 01/05/2007 15:36:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[spGetCharClan]
	@nCID INT
AS
	SELECT CLID From Character WHERE CID = @nCID


/****** Object:  StoredProcedure [dbo].[spGetClanInfo]    Script Date: 01/05/2007 15:37:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[spGetClanInfo] 
	@nCLID INT
AS
BEGIN
	SET NOCOUNT ON;

	SELECT Ranking,Losses,Wins,Point,TotalPoint,EmblemUrl,ClanMaster
	FROM Clans
	WHERE CLID = @nCLID
END





/****** Object:  StoredProcedure [dbo].[spGetCLIDFromClanName]    Script Date: 01/05/2007 15:37:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[spGetCLIDFromClanName]
	@nClanName varchar(10)
AS
	SELECT CLID From Clans WHERE Name = @nClanName



/****** Object:  StoredProcedure [dbo].[spRemoveClanMember]    Script Date: 01/05/2007 15:37:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[spRemoveClanMember] 
	@nCLID INT,
	@nCID INT
	
AS

	UPDATE Character SET ClanGrade = 0 WHERE CID = @nCID
	UPDATE Character SET ClanName = NULL WHERE CID = @nCID
	UPDATE Character SET CLID = NULL WHERE CID = @nCID
	DECLARE @nV INT
	SELECT @nV = MemberCount FROM Clans WHERE CLID = @nCLID
	UPDATE Clans SET MemberCount = @nV - 1 WHERE CLID = @nCLID

/****** Object:  StoredProcedure [dbo].[spUpdateClanGrade]    Script Date: 01/05/2007 15:38:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[spUpdateClanGrade] 
	@nCLID INT,
	@nCID INT,
	@nLEVEL INT
AS

	UPDATE Character SET ClanGrade = @nLEVEL WHERE CID = @nCID
 
Last edited:
RageZ Hell
Joined
Nov 17, 2006
Messages
511
Reaction score
0
is this clan system?
EDIT: i get this error
Msg 447, Level 16, State 1, Line 1
Expression type int is invalid for COLLATE clause.
Msg 154, Level 15, State 1, Procedure spAddClanMember, Line 16
a USE database statement is not allowed in a procedure, function or trigger.
 
Last edited:
C/C++ Programmer
Joined
Mar 1, 2006
Messages
315
Reaction score
195
all badly your scripts if you realized but you did not put yourself that the CLID is always 0 sos an alive Barbarian lets complete the data bases if you do not know to create procedures.
 
Experienced Elementalist
Joined
Nov 29, 2006
Messages
246
Reaction score
2
SirMaster go change the "Account Upgraded | Title Enabled!" in your profile it looks newb:lol:

And tnx for this.
 
Banned
Banned
Joined
Jan 13, 2007
Messages
1,898
Reaction score
65
on the last one i get it,
lol, just put
ALTER PROCEDURE
where CREATE PROC is
 
Last edited:
RageZ Hell
Joined
Nov 17, 2006
Messages
511
Reaction score
0
u copyed all and puted it to new Query and Execute?
 
C/C++ Programmer
Joined
Mar 1, 2006
Messages
315
Reaction score
195
my "Account Upgraded | Title Enabled!" already changed to "Account Upgraded | Title Enabled!" i dont change for other :D. xD.
 
RageZ Hell
Joined
Nov 17, 2006
Messages
511
Reaction score
0
i got all work but not creating table i just get
Msg 447, Level 16, State 1, Line 1
Expression type int is invalid for COLLATE clause.
this error
 
Banned
Banned
Joined
Jan 13, 2007
Messages
1,898
Reaction score
65
Msg 447, Level 16, State 1, Line 1
Expression type int is invalid for COLLATE clause. on dbo.clans

also what would happen if i tok
COLLATE SQL_Latin1_General_CP1_CI_AS
out?
 
Last edited:
C/C++ Programmer
Joined
Mar 1, 2006
Messages
315
Reaction score
195
Vitto. all badly your scripts if you realized but you did not put yourself that the CLID is always 0 sos an alive Barbarian lets complete the data bases if you do not know to create procedures.


YOU NO CREATE MORE PROCEDURES YOUR PROCEDURES IS WRONG CREATE CLAN CLID = 0??? NO NOOB IS COUNT NO 0....
 
C/C++ Programmer
Joined
Mar 1, 2006
Messages
315
Reaction score
195
CREATE PROC [dbo].[spCreateClan]
@nClanName INT,
@nMaster INT,
@nUser1 INT,
@nUser2 INT,
@nUser3 INT,
@nUser4 INT
AS
--DECLARE @nCount INT
--SELECT @nCount = COUNT(*) FROM Clans should work
DECLARE @nNameofMaster varchar(10)
SELECT @nNameofMaster = Name FROM Character WHERE CID = @nMaster
INSERT INTO Clans
VALUES(^^^^^^^^^^^^^^0^^^^^^^^^^^ IS ERROR and other scripts.,@nClanName,@nNameofMaster,NULL,0,0,0,0,5, 0,NULL)
UPDATE Character SET ClanName = @nClanName WHERE CID = @nMaster OR CID = @nUser1 OR CID = @nUser2 OR CID = @nUser3 OR CID = @nUser4
DECLARE @nV INT
SELECT @nV = CLID FROM Clans WHERE Name = @nClanName
UPDATE Character SET CLID = @nV
WHERE CID = @nMaster OR CID = @nUser1 OR CID = @nUser2 OR CID = @nUser3 OR CID = @nUser4

UPDATE Character SET ClanGrade = 1 WHERE CID = @nMaster
BEGIN
SET NOCOUNT ON;
SELECT CLID
FROM Clans
WHERE Name = @nClanName
END
 
Newbie Spellweaver
Joined
Jan 15, 2007
Messages
96
Reaction score
0
Jeezbus you guys are just plain nasty :schmoll:
Fine use that, it wouldn't work anyway.
 
Newbie Spellweaver
Joined
Jan 15, 2007
Messages
96
Reaction score
0
Thanks to Virustheking and SirMaster, you guys might just be able to create it.
Ps, i've added the right query back to the first post.
 
Banned
Banned
Joined
Jan 13, 2007
Messages
1,898
Reaction score
65
CREATE PROC [dbo].[spCreateClan]
@nClanName INT,
@nMaster INT,
@nUser1 INT,
@nUser2 INT,
@nUser3 INT,
@nUser4 INT
AS
--DECLARE @nCount INT
--SELECT @nCount = COUNT(*) FROM Clans should work
DECLARE @nNameofMaster varchar(10)
SELECT @nNameofMaster = Name FROM Character WHERE CID = @nMaster
INSERT INTO Clans
VALUES(^^^^^^^^^^^^^^0^^^^^^^^^^^ IS ERROR and other scripts.,@nClanName,@nNameofMaster,NULL,0,0,0,0,5, 0,NULL)
UPDATE Character SET ClanName = @nClanName WHERE CID = @nMaster OR CID = @nUser1 OR CID = @nUser2 OR CID = @nUser3 OR CID = @nUser4
DECLARE @nV INT
SELECT @nV = CLID FROM Clans WHERE Name = @nClanName
UPDATE Character SET CLID = @nV
WHERE CID = @nMaster OR CID = @nUser1 OR CID = @nUser2 OR CID = @nUser3 OR CID = @nUser4

UPDATE Character SET ClanGrade = 1 WHERE CID = @nMaster
BEGIN
SET NOCOUNT ON;
SELECT CLID
FROM Clans
WHERE Name = @nClanName
END

wtf what r you saying the 0 is an error?
 
Back
Top