Name in use error. Still no fix given.

12/20/2011 16:19 [Dev]RiseAgainst#1
I have just made a new server and i have come across a name in use error whenever trying to make a toon. This is the ONLY bug im experiencing this is the quiry i used to try and fix it
Code:
USE [PS_GameData]
GO
drop procedure [dbo].[usp_Save_Char_Item_Add_E]
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO


/****** 개체: 저장 프로시저 dbo.usp_Save_Char_Item_Add_E ******/


CREATE Proc usp_Save_Char_Item_Add_E

@CharID int,
@ItemUID bigint,
@Bag tinyint,
@Slot tinyint,
@ItemID int,
@Type tinyint,
@TypeID tinyint,
@Quality int,
@Gem1 tinyint,
@Gem2 tinyint,
@Gem3 tinyint,
@Gem4 tinyint,
@Gem5 tinyint,
@Gem6 tinyint,
@Craftname varchar(20) = '',
@Count tinyint,
@MaketimeZ varchar(50),
@Maketype char(1)

AS
DECLARE @Maketime as datetime
SELECT @Maketime = CONVERT(datetime, @MaketimeZ, 120)
--SET NOCOUNT ON

IF(@Quality >= 5000)
BEGIN
SET @Quality=0
END

INSERT INTO CharItems
(CharID, bag, slot, ItemID, Type, TypeID, ItemUID, quality, gem1, gem2, gem3, gem4,
gem5, gem6, craftname, [count], maketime, maketype)
VALUES(@CharID, @Bag, @Slot, @ItemID, @Type, @TypeID, @ItemUID, @Quality, @Gem1, @Gem2, @Gem3, @Gem4,
@Gem5, @Gem6, @Craftname, @Count, @Maketime, @Maketype)

IF(@@ERROR = 0)
BEGIN
RETURN 1
END
ELSE
BEGIN
RETURN -1
END

--SET NOCOUNT OFF



GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
Can anyone help to fix this? And yes the quiry did execute successfully and i restarted everything. And for you flamers i did use the search tool. :) thanks
12/20/2011 17:06 JohnHeatz#2
Sometimes it is needed to re-index your table after applying the script
12/20/2011 23:18 [Dev]RiseAgainst#3
Quote:
Originally Posted by JohnHeatz View Post
Sometimes it is needed to re-index your table after applying the script
lol how do you do that? and which table?
12/21/2011 07:54 JohnHeatz#4
Code:
USE [PS_GameData]
GO

/****** Object: Index [IX_Chars_CharName]******/
IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Chars]') 
AND name = N'IX_Chars_CharName')
DROP INDEX [IX_Chars_CharName] ON [dbo].[Chars] WITH ( ONLINE = OFF )
GO

USE [PS_GameData]
GO

/****** Object: Index [IX_Chars_CharName]******/
CREATE NONCLUSTERED INDEX [IX_Chars_CharName] ON [dbo].[Chars]
(
[CharName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, 
IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, 
ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
Hopefully this will fix your issue :rolleyes:
12/21/2011 17:04 [Dev]RiseAgainst#5
This is now fixed. I just attached a different GameData and it worked. Apparently my old one was corrupt.