Db Sql Format

Discussion about Helbreath Server Files.
Post Reply
IcEmoCHa
Regular
Posts: 37
Joined: Sat Aug 21, 2004 8:39 am

Post by IcEmoCHa »

MagicMan wrote: depends really but i found it either about same or less...which is good eh woot ..:)

also there a message the is sent from Client to server when recieving Angels....when you want one you can click it and then basiclly server close conns you as it doesn know the comman it getting..

it says "Unknown Message Recieved!Delete Client"

Anyone got a handle on this one is a star... :D
wow.. hope its fixed asap.. :D
MagicMan
Regular
Posts: 97
Joined: Sun Apr 04, 2004 9:38 am

Post by MagicMan »

IcEmoCHa wrote:
MagicMan wrote: depends really but i found it either about same or less...which is good eh woot ..:)

also there a message the is sent from Client to server when recieving Angels....when you want one you can click it and then basiclly server close conns you as it doesn know the comman it getting..

it says  "Unknown Message Recieved!Delete Client"

Anyone got a handle on this one is a star... :D
wow.. hope its fixed asap.. :D
Yeah wouldn that be awesome...Then basiclly anyone can run a server Like Nemesis...Putting them outta business i would think..LOL...fk em with there attitude thinking they think they only server with 3.72 files and client...Now EVERYONE can run a server just like them...That is if some bright spark can code HG with Angels in it..hehe...Not much of of a coder myself but i can dabble in it so i'm gonna have a go at fixin it...LOL wish me luck..LOL :ph34r:
MagicMan
Regular
Posts: 97
Joined: Sun Apr 04, 2004 9:38 am

Post by MagicMan »

BTW this happens with Both Chinese and 521 HG's tested both to check if one would be able to...but alas...no...also anyone done the hexing of 3.51 into 3.51-521 hg's...mine a little weird here it doesn have the address CDwriters say to copy from..(am I using the wrong hg..?)
MOG Hackintosh
Loyal fan
Posts: 362
Joined: Sun May 30, 2004 5:34 am

Post by MOG Hackintosh »

MagicMan wrote: Now EVERYONE can run a server just like them...
...as long as they are willing to pay, sure, why not. ;-)
<b>"I think im a hillbilly so pay me for my uber shiz" - Slipknight</b><span style='color:red'><br>yes and the dutch are always celebrating<br>thats holland:<br>"i got a new bicycle!" CHAMPAGNE! :D<br>"new marijuana bar opened" CHAMPAGNE :D <br>"it stopped raining for an hour" CHAMPAGNE! :D <br>"my condom didn't break" CHAMPAGNE! :D <br>"jews moved in next door" CHAMPAGNE! :D<br>"Look! A windmill!" CHAMPAGNE! :D</span>
CDWriter
Member
Posts: 123
Joined: Sun Feb 22, 2004 12:08 am

Post by CDWriter »

MagicMan wrote:
IcEmoCHa wrote:
MagicMan wrote: depends really but i found it either about same or less...which is good eh woot ..:)

also there a message the is sent from Client to server when recieving Angels....when you want one you can click it and then basiclly server close conns you as it doesn know the comman it getting..

it says  "Unknown Message Recieved!Delete Client"

Anyone got a handle on this one is a star... :D
wow.. hope its fixed asap.. :D
Yeah wouldn that be awesome...Then basiclly anyone can run a server Like Nemesis...Putting them outta business i would think..LOL...fk em with there attitude thinking they think they only server with 3.72 files and client...Now EVERYONE can run a server just like them...That is if some bright spark can code HG with Angels in it..hehe...Not much of of a coder myself but i can dabble in it so i'm gonna have a go at fixin it...LOL wish me luck..LOL :ph34r:
U need a New World Server to be able to get Angels !!! ;)
RageIlluminati
Outpost bitch
Posts: 559
Joined: Wed Mar 30, 2005 6:45 am

Post by RageIlluminati »

MagicMan wrote: k em with there attitude thinking they think they only server with 3.72 files and client...Now EVERYONE can run a server just like them...That is if some bright spark can code HG with Angels in it..hehe...Not much of of a coder myself but i can dabble in it so i'm gonna have a go at fixin it...LOL wish me luck..LOL :ph34r:
make a screenshot about your account_t where you have account.. and screenshot about character in character_t table with you can log in with 3.72 client...

go to SQL analyzer... take menu: Tools -> options, Results tab, there you see choice: Default Results Target: there you choose: Results to file

then execute in mainlog DB query: select * from account_t;
and from ws1 DB: select * from character_t;

then go to My Documents and upload these results files to here... I really want to know.. if there are any different things in your data.. why you can log in or not...
<img src='http://helbreath.pri.ee/userbars/hbest-gamemaster2.jpg' border='0' alt='user posted image' /> <img src='http://helbreath.pri.ee/userbars/hbsoccer-owner.jpg' border='0' alt='user posted image' /> <img src='http://helbreath.pri.ee/userbars/scorpa-rider.jpg' border='0' alt='user posted image' /> <img src='http://helbreath.pri.ee/userbars/logout-master.jpg' border='0' alt='user posted image' /> <br>.<br>................................Ego sum Rage, flagellum Dei!<br><br>The problem with America is stupidity. I'm not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? (bash.org)
MagicMan
Regular
Posts: 97
Joined: Sun Apr 04, 2004 9:38 am

Post by MagicMan »

Yes agreed CDwriter...don't suppose you have one in ya bag if tricks eh woot..? and i'll upload the mainlog and ws1 dumps shortly..late tonight...:)

Can we hex...recode worldserver to accept angels..? btw it was asking the HG not world for this ...it what i thought...maybe i'm wrong there bit if you goto get a angel from cmd hall your client will crash..take a look at elvine hg...it says the error not world..wierd..hope someone can fix it..
MagicMan
Regular
Posts: 97
Joined: Sun Apr 04, 2004 9:38 am

Post by MagicMan »

ok here's my mainlog

CREATE TABLE [ACCOUNT_T] (
[cAccountID] [nchar] (10) COLLATE Estonian_CI_AS NOT NULL ,
[cPasswd] [nchar] (10) COLLATE Estonian_CI_AS NULL ,
[iAccountID] [int] NOT NULL ,
[cLoginIpAddress] [nchar] (20) COLLATE Estonian_CI_AS NULL ,
[IsGMAccount] [bit] NULL ,
[CreateDate] [smalldatetime] NULL ,
[LoginDate] [smalldatetime] NULL ,
[LogoutDate] [smalldatetime] NULL ,
[BlockDate] [smalldatetime] NULL ,
[cRealName] [nchar] (30) COLLATE Estonian_CI_AS NULL ,
[cSSN] [nchar] (20) COLLATE Estonian_CI_AS NULL ,
[cEmail] [nchar] (60) COLLATE Estonian_CI_AS NULL ,
[cCharRecord] [nchar] (100) COLLATE Estonian_CI_AS NULL ,
[cQuiz] [nchar] (45) COLLATE Estonian_CI_AS NULL ,
[cAnswer] [nchar] (20) COLLATE Estonian_CI_AS NULL ,
[ValidDate] [smalldatetime] NULL ,
[iValidTime] [int] NULL ,
[iShopID] [int] NULL ,
[cKEYCODE] [nchar] (10) COLLATE Estonian_CI_AS NULL ,
[MaxUser] [int] NULL ,
CONSTRAINT [PK_ACCOUNT_T] PRIMARY KEY CLUSTERED
(
[cAccountID]
) ON [PRIMARY] ,
CONSTRAINT [UniqlACCOUNT_ID] UNIQUE NONCLUSTERED
(
[iAccountID]
) ON [PRIMARY]
) ON [PRIMARY]
GO


and my ws1

CREATE TABLE [CHARACTER_T] (
[cCharName] [nchar] (10) COLLATE Estonian_CI_AS NOT NULL ,
[cAccountID] [nchar] (10) COLLATE Estonian_CI_AS NOT NULL ,
[CharID] [int] NOT NULL ,
[sID1] [smallint] NULL ,
[sID2] [smallint] NULL ,
[sID3] [smallint] NULL ,
[sLevel] [smallint] NULL CONSTRAINT [DF__CHARACTER__sLeve__78B3EFCA] DEFAULT (1),
[sStr] [smallint] NULL ,
[sVit] [smallint] NULL ,
[sDex] [smallint] NULL ,
[sInt] [smallint] NULL ,
[sMag] [smallint] NULL ,
[sChar] [smallint] NULL ,
[iExp] [int] NULL CONSTRAINT [DF__CHARACTER___iExp__79A81403] DEFAULT (0),
[sUpStr] [smallint] NULL CONSTRAINT [DF__CHARACTER__sUpSt__7A9C383C] DEFAULT (0),
[sUpVit] [smallint] NULL CONSTRAINT [DF__CHARACTER__sUpVi__7B905C75] DEFAULT (0),
[sUpDex] [smallint] NULL CONSTRAINT [DF__CHARACTER__sUpDe__7C8480AE] DEFAULT (0),
[sUpInt] [smallint] NULL CONSTRAINT [DF__CHARACTER__sUpIn__7D78A4E7] DEFAULT (0),
[sUpMag] [smallint] NULL CONSTRAINT [DF__CHARACTER__sUpMa__7E6CC920] DEFAULT (0),
[sUpChar] [smallint] NULL CONSTRAINT [DF__CHARACTER__sUpCh__7F60ED59] DEFAULT (0),
[bGender] [bit] NULL ,
[sSkin] [smallint] NULL ,
[sHairStyle] [smallint] NULL ,
[sHairColor] [smallint] NULL ,
[sUnderWear] [smallint] NULL ,
[iApprColor] [int] NULL ,
[sAppr1] [smallint] NULL ,
[sAppr2] [smallint] NULL ,
[sAppr3] [smallint] NULL ,
[sAppr4] [smallint] NULL ,
[cNation] [nchar] (10) COLLATE Estonian_CI_AS NOT NULL ,
[cMapLoc] [nchar] (10) COLLATE Estonian_CI_AS NOT NULL ,
[sLocX] [smallint] NULL CONSTRAINT [DF__CHARACTER__sLocX__00551192] DEFAULT ((-1)),
[sLocY] [smallint] NULL CONSTRAINT [DF__CHARACTER__sLocY__014935CB] DEFAULT ((-1)),
[cProfile] [nchar] (70) COLLATE Estonian_CI_AS NOT NULL ,
[sAdminLevel] [smallint] NULL ,
[iContribution] [int] NULL ,
[iLeftSpecTime] [int] NULL ,
[cLockMapName] [nchar] (10) COLLATE Estonian_CI_AS NOT NULL ,
[iLockMapTime] [int] NULL ,
[FileSaveDate] [smalldatetime] NULL ,
[BlockDate] [smalldatetime] NULL ,
[cGuildName] [nchar] (20) COLLATE Estonian_CI_AS NOT NULL ,
[iGuildID] [int] NULL ,
[sGuildRank] [smallint] NULL ,
[sFightNum] [smallint] NULL ,
[sFightDate] [smallint] NULL ,
[sFightTicket] [smallint] NULL ,
[sQuestNum] [smallint] NULL ,
[sQuestID] [smallint] NULL ,
[sQuestCount] [smallint] NULL ,
[sQuestRewType] [smallint] NULL ,
[sQuestRewAmount] [smallint] NULL ,
[bQuestCompleted] [bit] NULL ,
[iEventID] [int] NULL ,
[iWarCon] [int] NULL ,
[iCruJob] [int] NULL ,
[iCruID] [int] NULL ,
[iCruConstructPoint] [int] NULL ,
[iPopular] [int] NULL ,
[iHP] [int] NULL ,
[iMP] [int] NULL ,
[iSP] [int] NULL ,
[iEK] [int] NULL ,
[iPK] [int] NULL ,
[iRewardGold] [int] NULL ,
[sDownSkillIDX] [smallint] NULL ,
[sHunger] [smallint] NULL ,
[sLeftSAC] [smallint] NULL ,
[iLeftShutupTime] [int] NULL ,
[iLeftPopTime] [int] NULL ,
[iLeftForceRecallTime] [int] NULL ,
[iLeftFirmStaminarTime] [int] NULL ,
[iLeftDeadpenaltyTime] [int] NULL ,
[cMagicMastery] [nchar] (100) COLLATE Estonian_CI_AS NOT NULL ,
[iPartyID] [int] NULL ,
[cKEYCODE] [nchar] (10) COLLATE Estonian_CI_AS NULL ,
[iGizonItemUpgradeLeft] [int] NULL CONSTRAINT [DF_CHARACTER_T_iGizonItemUpgradeLeft] DEFAULT (0),
CONSTRAINT [PK_CHARACTER_T] PRIMARY KEY CLUSTERED
(
[cCharName]
) ON [PRIMARY] ,
CONSTRAINT [CHARID] UNIQUE NONCLUSTERED
(
[CharID]
) ON [PRIMARY]
) ON [PRIMARY]
GO


hope this helps.. <_<
RageIlluminati
Outpost bitch
Posts: 559
Joined: Wed Mar 30, 2005 6:45 am

Post by RageIlluminati »

bah... as you used my scripts to make your SQLserver data.. I know the tables format.. I was interested in data you have there... maybe there is something different in that account or character data in the tables oin the character with you can log in with 3.72 client...

EDIT: I mean I have quite many NULL values in my account_t table

EDIT2: nvm... got it work.. my version of 3.72 client sucked...
<img src='http://helbreath.pri.ee/userbars/hbest-gamemaster2.jpg' border='0' alt='user posted image' /> <img src='http://helbreath.pri.ee/userbars/hbsoccer-owner.jpg' border='0' alt='user posted image' /> <img src='http://helbreath.pri.ee/userbars/scorpa-rider.jpg' border='0' alt='user posted image' /> <img src='http://helbreath.pri.ee/userbars/logout-master.jpg' border='0' alt='user posted image' /> <br>.<br>................................Ego sum Rage, flagellum Dei!<br><br>The problem with America is stupidity. I'm not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? (bash.org)
MagicMan
Regular
Posts: 97
Joined: Sun Apr 04, 2004 9:38 am

Post by MagicMan »

check your pm Rage..:)
MagicMan
Regular
Posts: 97
Joined: Sun Apr 04, 2004 9:38 am

Post by MagicMan »

Seems DMZ doesn work....But i think it is in cfg...i just know it as it same bug as previous server ...like 3.51..i remember there was same thing....ppl could login but person who was running server couldn..and visa verser...he could but no one else could..anyone rememebr what i'm goping on about..?HELP...lol
Stik
Member
Posts: 135
Joined: Thu Jun 10, 2004 4:59 pm

Post by Stik »

try useing your externall IP ,it should get bounced back from your ISP.
IcEmoCHa
Regular
Posts: 37
Joined: Sat Aug 21, 2004 8:39 am

Post by IcEmoCHa »

RageIlluminati wrote: bah... as you used my scripts to make your SQLserver data.. I know the tables format.. I was interested in data you have there... maybe there is something different in that account or character data in the tables oin the character with you can log in with 3.72 client...

EDIT: I mean I have quite many NULL values in my account_t table

EDIT2: nvm... got it work.. my version of 3.72 client sucked...
got them to work in txt format?... pls post... :D
cuz i keep getting forced log out / nulls in both sql and txt version...
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

What new functions does it has...like yeah client says 3.72 besides that...does angels works? crafting? :unsure:
QUOTE (ADDKiD @ Dec 1 2006, 4:01 PM) <br>You guys make me laugh alot, half the shit I say, is bullshit...<br><br><img src='http://img485.imageshack.us/img485/492/banssig1ng.gif' border='0' alt='user posted image' /><br><br><b>I see no changes at all, wake up in the morning and ask myself...<br>Is life worth living? Should I blast myself?</b><br><br><b><a href='http://2paclegacy.com' target='_blank'>2PacLegacy.com</a></b>
CDWriter
Member
Posts: 123
Joined: Sun Feb 22, 2004 12:08 am

Post by CDWriter »

MagicMan Your mainlog above

for 1 MagicMan if u hexedit the mainlogserver u will see its not asking for cKeyCode in Account_T...

form mainlog.

select * from CODE_T where cKEYCODE = '%s'

so theres your first mistake in your DB then if u search for select in mainlogserver.exe u will find all what u need for that , its the trick of adding it to db and haveing it COLLATE with your other records , but hey iam not a expert on MSSql , RageIlluminati is....but this is what i got ........


mainlogloginWorkswithasp - and its the whole file



Code: Select all

/****** Object:  Database mainlogin    Script Date: 9/4/2005 2:52:16 PM ******/
IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'mainlogin')
	DROP DATABASE [mainlogin]
GO

CREATE DATABASE [mainlogin]  ON (NAME = N'mainlogin', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL\data\mainlogin.mdf' , SIZE = 10, FILEGROWTH = 10%) LOG ON (NAME = N'mainlogin_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL\data\mainlogin_log.LDF' , SIZE = 2, FILEGROWTH = 10%)
 COLLATE Latin1_General_CI_AS
GO
ALTER DATABASE [mainlogin] ADD FILEGROUP [Second] 
GO
ALTER DATABASE [mainlogin] ADD FILE(NAME = N'mainlogin_idx', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL\data\mainlogin_idx.mdf' , SIZE = 10, FILEGROWTH = 10%) TO FILEGROUP [Second]
GO

exec sp_dboption N'mainlogin', N'autoclose', N'false'
GO

exec sp_dboption N'mainlogin', N'bulkcopy', N'false'
GO

exec sp_dboption N'mainlogin', N'trunc. log', N'false'
GO

exec sp_dboption N'mainlogin', N'torn page detection', N'true'
GO

exec sp_dboption N'mainlogin', N'read only', N'false'
GO

exec sp_dboption N'mainlogin', N'dbo use', N'false'
GO

exec sp_dboption N'mainlogin', N'single', N'false'
GO

exec sp_dboption N'mainlogin', N'autoshrink', N'false'
GO

exec sp_dboption N'mainlogin', N'ANSI null default', N'false'
GO

exec sp_dboption N'mainlogin', N'recursive triggers', N'false'
GO

exec sp_dboption N'mainlogin', N'ANSI nulls', N'false'
GO

exec sp_dboption N'mainlogin', N'concat null yields null', N'false'
GO

exec sp_dboption N'mainlogin', N'cursor close on commit', N'false'
GO

exec sp_dboption N'mainlogin', N'default to local cursor', N'false'
GO

exec sp_dboption N'mainlogin', N'quoted identifier', N'false'
GO

exec sp_dboption N'mainlogin', N'ANSI warnings', N'false'
GO

exec sp_dboption N'mainlogin', N'auto create statistics', N'true'
GO

exec sp_dboption N'mainlogin', N'auto update statistics', N'true'
GO

use [mainlogin]
GO

/****** Object:  Table [dbo].[ACCOUNT_T]    Script Date: 9/4/2005 2:52:17 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ACCOUNT_T]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ACCOUNT_T]
GO

/****** Object:  Table [dbo].[CODE_T]    Script Date: 9/4/2005 2:52:17 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CODE_T]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CODE_T]
GO

/****** Object:  Table [dbo].[WS1_T]    Script Date: 9/4/2005 2:52:17 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[WS1_T]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[WS1_T]
GO

/****** Object:  Table [dbo].[WS2_T]    Script Date: 9/4/2005 2:52:17 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[WS2_T]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[WS2_T]
GO

/****** Object:  Login CDWRITER\CDWs    Script Date: 9/4/2005 2:52:16 PM ******/
if not exists (select * from master.dbo.syslogins where loginname = N'CDWRITER\CDWs')
	exec sp_grantlogin N'CDWRITER\CDWs'
	exec sp_defaultdb N'CDWRITER\CDWs', N'master'
	exec sp_defaultlanguage N'CDWRITER\CDWs', N'us_english'
GO

/****** Object:  Login CDWRITER\CDWs    Script Date: 9/4/2005 2:52:16 PM ******/
exec sp_addsrvrolemember N'CDWRITER\CDWs', sysadmin
GO

/****** Object:  User dbo    Script Date: 9/4/2005 2:52:17 PM ******/
/****** Object:  Table [dbo].[ACCOUNT_T]    Script Date: 9/4/2005 2:52:18 PM ******/
CREATE TABLE [dbo].[ACCOUNT_T] (
	[cAccountID] [nchar] (10) COLLATE Latin1_General_CI_AS NOT NULL ,
	[cPasswd] [nchar] (10) COLLATE Latin1_General_CI_AS NULL ,
	[iAccountID] [int] IDENTITY (1001, 1) NOT NULL ,
	[cLoginIpAddress] [nchar] (20) COLLATE Latin1_General_CI_AS NULL ,
	[IsGMAccount] [bit] NULL ,
	[CreateDate] [smalldatetime] NULL ,
	[LoginDate] [smalldatetime] NULL ,
	[LogoutDate] [smalldatetime] NULL ,
	[BlockDate] [smalldatetime] NULL ,
	[cRealName] [nchar] (30) COLLATE Latin1_General_CI_AS NULL ,
	[cSSN] [nchar] (20) COLLATE Latin1_General_CI_AS NULL ,
	[cEmail] [nchar] (60) COLLATE Latin1_General_CI_AS NULL ,
	[cCharRecord] [nchar] (100) COLLATE Latin1_General_CI_AS NULL ,
	[cQuiz] [nchar] (45) COLLATE Latin1_General_CI_AS NULL ,
	[cAnswer] [nchar] (20) COLLATE Latin1_General_CI_AS NULL ,
	[ValidDate] [smalldatetime] NULL ,
	[iValidTime] [int] NULL ,
	[MaxUser] [int] NULL ,
	[iShopID] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[CODE_T]    Script Date: 9/4/2005 2:52:18 PM ******/
CREATE TABLE [dbo].[CODE_T] (
	[iAccountID] [int] IDENTITY (1, 1) NOT NULL ,
	[cCharName] [nchar] (10) COLLATE Latin1_General_CI_AS NULL ,
	[cKEYCODE] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[WS1_T]    Script Date: 9/4/2005 2:52:18 PM ******/
CREATE TABLE [dbo].[WS1_T] (
	[iAccountID] [int] NOT NULL ,
	[cCharName] [nchar] (10) COLLATE Latin1_General_CI_AS NULL ,
	[cKEYCODE] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[WS2_T]    Script Date: 9/4/2005 2:52:18 PM ******/
CREATE TABLE [dbo].[WS2_T] (
	[iAccountID] [int] NOT NULL ,
	[cCharName] [nchar] (10) COLLATE Latin1_General_CI_AS NOT NULL ,
	[cKEYCODE] [nchar] (10) COLLATE Latin1_General_CI_AS NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[CODE_T] WITH NOCHECK ADD 
	CONSTRAINT [IX_CODE_T] UNIQUE  NONCLUSTERED 
	(
  [iAccountID]
	) WITH  FILLFACTOR = 80  ON [PRIMARY] 
GO

 CREATE  INDEX [WS1_IDX] ON [dbo].[WS1_T]([iAccountID]) WITH  FILLFACTOR = 80,  STATISTICS_NORECOMPUTE  ON [Second]
GO

now for the WS1 db u have the same problem your useing [cKEYCODE] [nchar] (10) COLLATE Estonian_CI_AS NULL , but wait whats the statement form MainlogServer.exe ...

select * from CODE_T where cKEYCODE = '%s'

so that does not fit eather ?

heres mine.....

Code: Select all

/****** Object:  Database ws1    Script Date: 6/2/2005 2:01:11 PM ******/
IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'ws1')
	DROP DATABASE [ws1]
GO

CREATE DATABASE [ws1]  ON (NAME = N'ws1', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL\data\ws1.mdf' , SIZE = 100, FILEGROWTH = 10%) LOG ON (NAME = N'ws1_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL\data\ws1_log.LDF' , SIZE = 25, FILEGROWTH = 10%)
 COLLATE Latin1_General_CI_AS
GO
ALTER DATABASE [ws1] ADD FILEGROUP [Second] 
GO
ALTER DATABASE [ws1] ADD FILE(NAME = N'ws1_idx', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL\data\ws1_idx.mdf' , SIZE = 10, FILEGROWTH = 10%) TO FILEGROUP [Second]
GO

exec sp_dboption N'ws1', N'autoclose', N'false'
GO

exec sp_dboption N'ws1', N'bulkcopy', N'false'
GO

exec sp_dboption N'ws1', N'trunc. log', N'false'
GO

exec sp_dboption N'ws1', N'torn page detection', N'true'
GO

exec sp_dboption N'ws1', N'read only', N'false'
GO

exec sp_dboption N'ws1', N'dbo use', N'false'
GO

exec sp_dboption N'ws1', N'single', N'false'
GO

exec sp_dboption N'ws1', N'autoshrink', N'false'
GO

exec sp_dboption N'ws1', N'ANSI null default', N'false'
GO

exec sp_dboption N'ws1', N'recursive triggers', N'false'
GO

exec sp_dboption N'ws1', N'ANSI nulls', N'false'
GO

exec sp_dboption N'ws1', N'concat null yields null', N'false'
GO

exec sp_dboption N'ws1', N'cursor close on commit', N'false'
GO

exec sp_dboption N'ws1', N'default to local cursor', N'false'
GO

exec sp_dboption N'ws1', N'quoted identifier', N'false'
GO

exec sp_dboption N'ws1', N'ANSI warnings', N'false'
GO

exec sp_dboption N'ws1', N'auto create statistics', N'true'
GO

exec sp_dboption N'ws1', N'auto update statistics', N'true'
GO

use [ws1]
GO

/****** Object:  Stored Procedure dbo.sp_GetCrusadeLastLoser    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_GetCrusadeLastLoser]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_GetCrusadeLastLoser]
GO

/****** Object:  Stored Procedure dbo.sp_GetCrusadeLastWinner    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_GetCrusadeLastWinner]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_GetCrusadeLastWinner]
GO

/****** Object:  Stored Procedure dbo.sp_GetHeldenianLastLoser    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_GetHeldenianLastLoser]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_GetHeldenianLastLoser]
GO

/****** Object:  Stored Procedure dbo.sp_GetHeldenianLastWinner    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_GetHeldenianLastWinner]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_GetHeldenianLastWinner]
GO

/****** Object:  Stored Procedure dbo.sp_SetCrusadeDraw    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_SetCrusadeDraw]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_SetCrusadeDraw]
GO

/****** Object:  Stored Procedure dbo.sp_SetCrusadeLoserAresden    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_SetCrusadeLoserAresden]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_SetCrusadeLoserAresden]
GO

/****** Object:  Stored Procedure dbo.sp_SetCrusadeLoserElvine    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_SetCrusadeLoserElvine]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_SetCrusadeLoserElvine]
GO

/****** Object:  Stored Procedure dbo.sp_SetCrusadeWinner    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_SetCrusadeWinner]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_SetCrusadeWinner]
GO

/****** Object:  Stored Procedure dbo.sp_SetCrusadeWinnerAresden    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_SetCrusadeWinnerAresden]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_SetCrusadeWinnerAresden]
GO

/****** Object:  Stored Procedure dbo.sp_SetCrusadeWinnerElvine    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_SetCrusadeWinnerElvine]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_SetCrusadeWinnerElvine]
GO

/****** Object:  Stored Procedure dbo.sp_SetHeldenianDraw    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_SetHeldenianDraw]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_SetHeldenianDraw]
GO

/****** Object:  Stored Procedure dbo.sp_SetHeldenianLoserAresden    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_SetHeldenianLoserAresden]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_SetHeldenianLoserAresden]
GO

/****** Object:  Stored Procedure dbo.sp_SetHeldenianLoserElvine    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_SetHeldenianLoserElvine]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_SetHeldenianLoserElvine]
GO

/****** Object:  Stored Procedure dbo.sp_SetHeldenianWinner    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_SetHeldenianWinner]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_SetHeldenianWinner]
GO

/****** Object:  Stored Procedure dbo.sp_SetHeldenianWinnerAresden    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_SetHeldenianWinnerAresden]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_SetHeldenianWinnerAresden]
GO

/****** Object:  Stored Procedure dbo.sp_SetHeldenianWinnerElvine    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_SetHeldenianWinnerElvine]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_SetHeldenianWinnerElvine]
GO

/****** Object:  Table [dbo].[BANKITEM_T]    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BANKITEM_T]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BANKITEM_T]
GO

/****** Object:  Table [dbo].[CHARACTER_T]    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CHARACTER_T]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CHARACTER_T]
GO

/****** Object:  Table [dbo].[CODE_T]    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CODE_T]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CODE_T]
GO

/****** Object:  Table [dbo].[CrusadeReportT]    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CrusadeReportT]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CrusadeReportT]
GO

/****** Object:  Table [dbo].[CrusadeResultT]    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CrusadeResultT]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CrusadeResultT]
GO

/****** Object:  Table [dbo].[GUILDMEMBER_T]    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GUILDMEMBER_T]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[GUILDMEMBER_T]
GO

/****** Object:  Table [dbo].[GUILD_T]    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GUILD_T]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[GUILD_T]
GO

/****** Object:  Table [dbo].[HeldenianReportT]    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HeldenianReportT]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HeldenianReportT]
GO

/****** Object:  Table [dbo].[HeldenianResultT]    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HeldenianResultT]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HeldenianResultT]
GO

/****** Object:  Table [dbo].[ITEM_T]    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ITEM_T]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ITEM_T]
GO

/****** Object:  Table [dbo].[SKILL_T]    Script Date: 6/2/2005 2:01:13 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SKILL_T]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[SKILL_T]
GO

/****** Object:  User dbo    Script Date: 6/2/2005 2:01:11 PM ******/
/****** Object:  Table [dbo].[BANKITEM_T]    Script Date: 6/2/2005 2:01:13 PM ******/
CREATE TABLE [dbo].[BANKITEM_T] (
	[CharID] [int] NOT NULL ,
	[sItemID] [smallint] NULL ,
	[iCount] [int] NULL ,
	[sItemType] [smallint] NULL ,
	[sID1] [smallint] NULL ,
	[sID2] [smallint] NULL ,
	[sID3] [smallint] NULL ,
	[sColor] [smallint] NULL ,
	[sEffect1] [smallint] NULL ,
	[sEffect2] [smallint] NULL ,
	[sEffect3] [smallint] NULL ,
	[iLifeSpan] [int] NULL ,
	[iAttribute] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[CHARACTER_T]    Script Date: 6/2/2005 2:01:14 PM ******/
CREATE TABLE [dbo].[CHARACTER_T] (
	[cCharName] [nchar] (10) COLLATE Latin1_General_CI_AS NOT NULL ,
	[cAccountID] [nchar] (10) COLLATE Latin1_General_CI_AS NOT NULL ,
	[CharID] [int] NOT NULL ,
	[sID1] [smallint] NULL ,
	[sID2] [smallint] NULL ,
	[sID3] [smallint] NULL ,
	[sLevel] [smallint] NULL ,
	[sStr] [smallint] NULL ,
	[sVit] [smallint] NULL ,
	[sDex] [smallint] NULL ,
	[sInt] [smallint] NULL ,
	[sMag] [smallint] NULL ,
	[sChar] [smallint] NULL ,
	[iExp] [int] NULL ,
	[sUpStr] [smallint] NULL ,
	[sUpVit] [smallint] NULL ,
	[sUpDex] [smallint] NULL ,
	[sUpInt] [smallint] NULL ,
	[sUpMag] [smallint] NULL ,
	[sUpChar] [smallint] NULL ,
	[bGender] [bit] NULL ,
	[sSkin] [smallint] NULL ,
	[sHairStyle] [smallint] NULL ,
	[sHairColor] [smallint] NULL ,
	[sUnderWear] [smallint] NULL ,
	[iApprColor] [int] NULL ,
	[sAppr1] [smallint] NULL ,
	[sAppr2] [smallint] NULL ,
	[sAppr3] [smallint] NULL ,
	[sAppr4] [smallint] NULL ,
	[cNation] [nchar] (10) COLLATE Latin1_General_CI_AS NULL ,
	[cMapLoc] [nchar] (10) COLLATE Latin1_General_CI_AS NULL ,
	[sLocX] [smallint] NULL ,
	[sLocY] [smallint] NULL ,
	[cProfile] [nchar] (70) COLLATE Latin1_General_CI_AS NULL ,
	[sAdminLevel] [smallint] NULL ,
	[iContribution] [int] NULL ,
	[iLeftSpecTime] [int] NULL ,
	[cLockMapName] [nchar] (10) COLLATE Latin1_General_CI_AS NULL ,
	[iLockMapTime] [int] NULL ,
	[FileSaveDate] [smalldatetime] NULL ,
	[BlockDate] [smalldatetime] NULL ,
	[cGuildName] [nchar] (20) COLLATE Latin1_General_CI_AS NULL ,
	[iGuildID] [int] NULL ,
	[sGuildRank] [smallint] NULL ,
	[sFightNum] [smallint] NULL ,
	[sFightDate] [smallint] NULL ,
	[sFightTicket] [smallint] NULL ,
	[sQuestNum] [smallint] NULL ,
	[sQuestID] [smallint] NULL ,
	[sQuestCount] [smallint] NULL ,
	[sQuestRewType] [smallint] NULL ,
	[sQuestRewAmount] [smallint] NULL ,
	[bQuestCompleted] [bit] NULL ,
	[iEventID] [int] NULL ,
	[iWarCon] [int] NULL ,
	[iCruJob] [int] NULL ,
	[iCruID] [int] NULL ,
	[iCruConstructPoint] [int] NULL ,
	[iPopular] [int] NULL ,
	[iHP] [int] NULL ,
	[iMP] [int] NULL ,
	[iSP] [int] NULL ,
	[iEK] [int] NULL ,
	[iPK] [int] NULL ,
	[iRewardGold] [int] NULL ,
	[sDownSkillIDX] [smallint] NULL ,
	[sHunger] [smallint] NULL ,
	[sLeftSAC] [smallint] NULL ,
	[iLeftShutupTime] [int] NULL ,
	[iLeftPopTime] [int] NULL ,
	[iLeftForceRecallTime] [int] NULL ,
	[iLeftFirmStaminarTime] [int] NULL ,
	[iLeftDeadpenaltyTime] [int] NULL ,
	[cMagicMastery] [nchar] (100) COLLATE Latin1_General_CI_AS NULL ,
	[iPartyID] [int] NULL ,
	[iGizoneItemUpgradeLeft] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[CODE_T]    Script Date: 6/2/2005 2:01:15 PM ******/
CREATE TABLE [dbo].[CODE_T] (
	[iAccountID] [int] NOT NULL ,
	[cCharName] [nchar] (10) COLLATE Latin1_General_CI_AS NOT NULL ,
	[cKEYCODE] [nchar] (10) COLLATE Latin1_General_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[CrusadeReportT]    Script Date: 6/2/2005 2:01:15 PM ******/
CREATE TABLE [dbo].[CrusadeReportT] (
	[startDate] [datetime] NOT NULL ,
	[endDate] [datetime] NOT NULL ,
	[winner] [char] (7) COLLATE Latin1_General_CI_AS NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[CrusadeResultT]    Script Date: 6/2/2005 2:01:15 PM ******/
CREATE TABLE [dbo].[CrusadeResultT] (
	[nation] [char] (7) COLLATE Latin1_General_CI_AS NOT NULL ,
	[totalWin] [int] NULL ,
	[lastWar] [char] (4) COLLATE Latin1_General_CI_AS NOT NULL ,
	[lastResultCount] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[GUILDMEMBER_T]    Script Date: 6/2/2005 2:01:15 PM ******/
CREATE TABLE [dbo].[GUILDMEMBER_T] (
	[cGuildName] [nchar] (20) COLLATE Latin1_General_CI_AS NOT NULL ,
	[cMemberName] [nchar] (10) COLLATE Latin1_General_CI_AS NULL ,
	[JoinDate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[GUILD_T]    Script Date: 6/2/2005 2:01:15 PM ******/
CREATE TABLE [dbo].[GUILD_T] (
	[cGuildName] [nchar] (20) COLLATE Latin1_General_CI_AS NOT NULL ,
	[iGuildID] [int] NULL ,
	[cMasterName] [nchar] (10) COLLATE Latin1_General_CI_AS NULL ,
	[cLocation] [nchar] (10) COLLATE Latin1_General_CI_AS NULL ,
	[sMemberNO] [smallint] NULL ,
	[CreateDate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[HeldenianReportT]    Script Date: 6/2/2005 2:01:15 PM ******/
CREATE TABLE [dbo].[HeldenianReportT] (
	[startDate] [datetime] NOT NULL ,
	[endDate] [datetime] NOT NULL ,
	[winner] [char] (7) COLLATE Latin1_General_CI_AS NOT NULL ,
	[type] [int] NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[HeldenianResultT]    Script Date: 6/2/2005 2:01:15 PM ******/
CREATE TABLE [dbo].[HeldenianResultT] (
	[nation] [char] (7) COLLATE Latin1_General_CI_AS NOT NULL ,
	[totalWin] [int] NULL ,
	[lastWar] [char] (4) COLLATE Latin1_General_CI_AS NOT NULL ,
	[lastResultCount] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[ITEM_T]    Script Date: 6/2/2005 2:01:15 PM ******/
CREATE TABLE [dbo].[ITEM_T] (
	[CharID] [int] NOT NULL ,
	[sItemID] [smallint] NULL ,
	[iCount] [int] NULL ,
	[sItemType] [smallint] NULL ,
	[sID1] [smallint] NULL ,
	[sID2] [smallint] NULL ,
	[sID3] [smallint] NULL ,
	[sColor] [smallint] NULL ,
	[sEffect1] [smallint] NULL ,
	[sEffect2] [smallint] NULL ,
	[sEffect3] [smallint] NULL ,
	[iLifeSpan] [int] NULL ,
	[iAttribute] [int] NULL ,
	[bItemEquip] [bit] NULL ,
	[sItemPosX] [smallint] NULL ,
	[sItemPosY] [smallint] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[SKILL_T]    Script Date: 6/2/2005 2:01:15 PM ******/
CREATE TABLE [dbo].[SKILL_T] (
	[CharID] [int] NOT NULL ,
	[sSkillID] [smallint] NULL ,
	[sSkillMastery] [smallint] NULL ,
	[iSkillSSN] [int] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[CrusadeReportT] WITH NOCHECK ADD 
  CHECK ([Winner] = 'draw' or ([Winner] = 'elvine' or [Winner] = 'aresden'))
GO

ALTER TABLE [dbo].[CrusadeResultT] WITH NOCHECK ADD 
	CONSTRAINT [DF__CrusadeRe__total__4E88ABD4] DEFAULT (0) FOR [totalWin],
	CONSTRAINT [DF__CrusadeRe__lastR__5070F446] DEFAULT (0) FOR [lastResultCount],
  UNIQUE  NONCLUSTERED 
	(
  [nation]
	)  ON [PRIMARY] ,
  CHECK ([lastWar] = 'draw' or ([lastWar] = 'win' or [lastWar] = 'lose')),
  CHECK ([nation] = 'draw' or ([nation] = 'elvine' or [nation] = 'aresden'))
GO

ALTER TABLE [dbo].[HeldenianReportT] WITH NOCHECK ADD 
  CHECK ([Winner] = 'draw' or ([Winner] = 'elvine' or [Winner] = 'aresden'))
GO

ALTER TABLE [dbo].[HeldenianResultT] WITH NOCHECK ADD 
	CONSTRAINT [DF__Heldenian__total__5DCAEF64] DEFAULT (0) FOR [totalWin],
	CONSTRAINT [DF__Heldenian__lastR__5FB337D6] DEFAULT (0) FOR [lastResultCount],
  UNIQUE  NONCLUSTERED 
	(
  [nation]
	)  ON [PRIMARY] ,
  CHECK ([lastWar] = 'draw' or ([lastWar] = 'win' or [lastWar] = 'lose')),
  CHECK ([nation] = 'draw' or ([nation] = 'elvine' or [nation] = 'aresden'))
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_GetCrusadeLastLoser    Script Date: 6/2/2005 2:01:16 PM ******/

CREATE PROC sp_GetCrusadeLastLoser
AS
	SELECT * FROM CrusadeResultT WHERE lastWar='lose'

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_GetCrusadeLastWinner    Script Date: 6/2/2005 2:01:16 PM ******/

CREATE PROC sp_GetCrusadeLastWinner
AS
	SELECT * FROM CrusadeResultT WHERE lastWar='win'

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_GetHeldenianLastLoser    Script Date: 6/2/2005 2:01:16 PM ******/

CREATE PROC sp_GetHeldenianLastLoser
AS
	SELECT * FROM HeldenianResultT WHERE lastWar='lose'

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_GetHeldenianLastWinner    Script Date: 6/2/2005 2:01:16 PM ******/

CREATE PROC sp_GetHeldenianLastWinner
AS
	SELECT * FROM HeldenianResultT WHERE lastWar='win'

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_SetCrusadeDraw    Script Date: 6/2/2005 2:01:16 PM ******/

CREATE PROC sp_SetCrusadeDraw
AS
	UPDATE CrusadeResultT SET totalWin=totalWin+1 WHERE nation='draw'

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_SetCrusadeLoserAresden    Script Date: 6/2/2005 2:01:16 PM ******/


CREATE PROC sp_SetCrusadeLoserAresden
AS
	UPDATE CrusadeResultT SET lastWar='lose', lastResultCount=0 WHERE nation='aresden' and lastWar='win'
	UPDATE CrusadeResultT SET lastResultCount=lastResultCount+1 WHERE nation='aresden'

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_SetCrusadeLoserElvine    Script Date: 6/2/2005 2:01:16 PM ******/

CREATE PROC sp_SetCrusadeLoserElvine
AS
	UPDATE CrusadeResultT SET lastWar='lose', lastResultCount=0 WHERE nation='elvine' and lastWar='win'
	UPDATE CrusadeResultT SET lastResultCount=lastResultCount+1 WHERE nation='elvine'

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_SetCrusadeWinner    Script Date: 6/2/2005 2:01:16 PM ******/
CREATE PROC sp_SetCrusadeWinner
	@Winner  CHAR(7),
	@StartDate	DATETIME,
	@EndDate	DATETIME
AS
	IF( @Winner = 'aresden' )
	BEGIN
  EXEC sp_SetCrusadeWinnerAresden
  EXEC sp_SetCrusadeLoserElvine
	END
	ELSE IF ( @Winner = 'elvine' )
	BEGIN
  EXEC sp_SetCrusadeWinnerElvine
  EXEC sp_SetCrusadeLoserAresden
	ENd
	ELSE IF ( @Winner = 'draw' )
	BEGIN
  EXEC sp_SetCrusadeDraw
	END

	INSERT INTO CrusadeReportT VALUES ( @StartDate, @EndDate, @Winner );

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_SetCrusadeWinnerAresden    Script Date: 6/2/2005 2:01:16 PM ******/

CREATE PROC sp_SetCrusadeWinnerAresden
AS
	UPDATE CrusadeResultT SET lastWar='win', lastResultCount=0 WHERE nation='aresden' and lastWar='lose'
	UPDATE CrusadeResultT SET lastResultCount=lastResultCount+1, totalWin=totalWin+1 WHERE nation='aresden'

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_SetCrusadeWinnerElvine    Script Date: 6/2/2005 2:01:16 PM ******/

CREATE PROC sp_SetCrusadeWinnerElvine
AS
	UPDATE CrusadeResultT SET lastWar='win', lastResultCount=0 WHERE nation='elvine' and lastWar='lose'
	UPDATE CrusadeResultT SET lastResultCount=lastResultCount+1, totalWin=totalWin+1 WHERE nation='elvine'

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_SetHeldenianDraw    Script Date: 6/2/2005 2:01:16 PM ******/

CREATE PROC sp_SetHeldenianDraw
AS
	UPDATE HeldenianResultT SET totalWin=totalWin+1 WHERE nation='draw'

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_SetHeldenianLoserAresden    Script Date: 6/2/2005 2:01:16 PM ******/


CREATE PROC sp_SetHeldenianLoserAresden
AS
	UPDATE HeldenianResultT SET lastWar='lose', lastResultCount=0 WHERE nation='aresden' and lastWar='win'
	UPDATE HeldenianResultT SET lastResultCount=lastResultCount+1 WHERE nation='aresden'

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_SetHeldenianLoserElvine    Script Date: 6/2/2005 2:01:16 PM ******/

CREATE PROC sp_SetHeldenianLoserElvine
AS
	UPDATE HeldenianResultT SET lastWar='lose', lastResultCount=0 WHERE nation='elvine' and lastWar='win'
	UPDATE HeldenianResultT SET lastResultCount=lastResultCount+1 WHERE nation='elvine'

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_SetHeldenianWinner    Script Date: 6/2/2005 2:01:16 PM ******/
CREATE PROC sp_SetHeldenianWinner
	@Winner  CHAR(7),
	@StartDate	DATETIME,
	@EndDate	DATETIME,
	@Type  INT
AS
	IF( @Winner = 'aresden' )
	BEGIN
  EXEC sp_SetHeldenianWinnerAresden
  EXEC sp_SetHeldenianLoserElvine
	END
	ELSE IF ( @Winner = 'elvine' )
	BEGIN
  EXEC sp_SetHeldenianWinnerElvine
  EXEC sp_SetHeldenianLoserAresden
	ENd
	ELSE IF ( @Winner = 'draw' )
	BEGIN
  EXEC sp_SetHeldenianDraw
	END

	INSERT INTO HeldenianReportT VALUES ( @StartDate, @EndDate, @Winner, @Type );

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_SetHeldenianWinnerAresden    Script Date: 6/2/2005 2:01:16 PM ******/

CREATE PROC sp_SetHeldenianWinnerAresden
AS
	UPDATE HeldenianResultT SET lastWar='win', lastResultCount=0 WHERE nation='aresden' and lastWar='lose'
	UPDATE HeldenianResultT SET lastResultCount=lastResultCount+1, totalWin=totalWin+1 WHERE nation='aresden'

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

/****** Object:  Stored Procedure dbo.sp_SetHeldenianWinnerElvine    Script Date: 6/2/2005 2:01:16 PM ******/

CREATE PROC sp_SetHeldenianWinnerElvine
AS
	UPDATE HeldenianResultT SET lastWar='win', lastResultCount=0 WHERE nation='elvine' and lastWar='lose'
	UPDATE HeldenianResultT SET lastResultCount=lastResultCount+1, totalWin=totalWin+1 WHERE nation='elvine'

GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


And u see above i have it setup for ASP ......So someone signs up for a account it will create the account and give them a AccountID # lets say 1000 then next person who signs up will get 1001 and so on thats why i have it
[iAccountID] [int] IDENTITY (1001, 1) NOT NULL ,

start at 1001 add 1 for each new User 1002 , 1003 and so on.....Iam not that good at MSSQL but its not thathard to figure it out :) and alot of this i want to thank Nick (AKA ???Miss u man) for sending me in the right directions when i was in a Wonder....


OO and to make sure u all understand this still does not let u change your Password from Client but its the closet thing I think is correct so far.....Anyone who knows there shit please respond to this and correct me if u like .....
Post Reply