MalditoxD Admin
Mensajes : 12 Fecha de inscripción : 18/02/2012
| Tema: Solucion WePro Guild Lun Feb 20, 2012 11:16 pm | |
| Dejo la Solucion del WePro Funka al 100%... Todo lo que deben hacer, es ejecutar la siguiente consulta en el Query Analizer (Analizador de Consultas) seleccionando la base de datos MuOnline (o la que utilicen en su servidor): - Spoiler:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[WZ_GuildCreate]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[WZ_GuildCreate] GO
SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO
CREATE procedure WZ_GuildCreate @GuildName nvarchar(50), @MasterName nvarchar(10) as
IF (SELECT COUNT(*) FROM guild where G_Name=@GuildName )=0
BEGIN DECLARE @p INTEGER DECLARE @ErrorCode int
SET @ErrorCode = 0 SET XACT_ABORT OFF
Set nocount on
begin transaction
SELECT @p = PATINDEX('%[^a-zA-Z0-9_^!~*]%',@GuildName) IF(@p > 0) BEGIN SET @ErrorCode = 1 END
IF(@ErrorCode = 0) BEGIN
INSERT INTO Guild (G_Name,G_Master,G_Score) values (@GuildName, @MasterName, 0) IF(@@Error <> 0) BEGIN SET @ErrorCode = 1 END END
IF(@ErrorCode = 0) BEGIN
INSERT GuildMember (Name, G_Name, G_Level) values (@MasterName, @GuildName, 1) IF (@@Error <> 0) BEGIN SET @ErrorCode = 2 END END
IF(@ErrorCode <> 0) rollback transaction ELSE commit transaction
select @ErrorCode
Set nocount off SET XACT_ABORT ON END GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO
En caso de que no funcione, borren previamente el procedimiento WZ_GuildCreate. Si quieren saber como funciona, es muy simple... todo lo que hace es filtrar los caracteres ingresados en el campo G_Name y admitir solo los que coloquen en el filtro. - Spoiler:
SELECT @p = PATINDEX('%[^a-zA-Z0-9_^!~*]%',@GuildName)
Creditos: Alkon | |
|