Query Trocar nome do char
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
|