Secret Experience

Secret Experience (https://secretexperience.net/)
-   [MU | Admin] SQL e Scripts (https://secretexperience.net/mu-admin-sql-e-scripts/)
-   -   Query Trocar nome do char (https://secretexperience.net/mu-admin-sql-e-scripts/25598-query-trocar-nome-do-char.html)

darkg4 21-09-2010 10:30 PM

Query Trocar nome do char
 
1 Anexo(s)
Basta por o nome antigo, o novo nome e rodar a query.


declare @novo_nome varchar(10),
@antigo_nome varchar(10)

-- Variaveis ----------------------------------------------------

set @antigo_nome = 'AntigoNome' -- Entre 4 e 10 Caracteres
set @novo_nome = 'NovoNome' -- Entre 4 e 10 Caracteres

-----------------------------------------------------------------

IF (SELECT Count(name) FROM Character WHERE Name = @novo_nome) > 0
BEGIN
PRINT 'O PERSONAGEM ' + @novo_nome + ' JA EXISTE NO BANCO DE DADOS'
END

ELSE IF (SELECT Count(name) FROM Character WHERE Name = @antigo_nome) = 0
BEGIN
PRINT 'O PERSONAGEM ' + @antigo_nome + ' NAO EXISTE NO BANCO DE DADOS'
END

ELSE
BEGIN
PRINT 'O PERSONAGEM ' + @antigo_nome + ' AGORA SE CHAMA ' + @novo_nome
Update AccountCharacter SET GameID1 = @novo_nome WHERE GameID1 = @antigo_nome
Update AccountCharacter SET GameID2 = @novo_nome WHERE GameID2 = @antigo_nome
Update AccountCharacter SET GameID3 = @novo_nome WHERE GameID3 = @antigo_nome
Update AccountCharacter SET GameID4 = @novo_nome WHERE GameID4 = @antigo_nome
Update AccountCharacter SET GameID5 = @novo_nome WHERE GameID5 = @antigo_nome
Update AccountCharacter SET GameIDC = @novo_nome WHERE GameIDC = @antigo_nome
Update Character SET Name = @novo_nome WHERE Name = @antigo_nome
Update Guild SET G_Master = @novo_nome WHERE G_Master = @antigo_nome
Update GuildMember SET Name = @novo_nome WHERE Name = @antigo_nome
Update OptionData SET Name = @novo_nome WHERE Name = @antigo_nome
END


Horários baseados na GMT -3. Agora são 08:16 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.