Ver um Único Post
Antigo 21-09-2010, 10:30 PM   #1 (permalink)
darkg4
Membro - Recruta
 
Avatar de darkg4
 
Registrado em: Aug 2009
Posts: 1
Agradeceu: 0
Agradecido 4 Vezes em 1 Post
Achei Ruim:
Acharam ruim Vezes em Posts

Inventório de darkg4

Icon2 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

Arquivos Anexados
Tipo de Arquivo: sql Query Item.sql (106 Bytes, 68 visualizações) Baixar
darkg4 está offline   Responder com Citação
Os Seguintes 4 Usuários disseram Obrigado(a) para darkg4 por gostarem deste post :
giovannipassos (06-11-2011), Lavinas (10-05-2011), valdair (07-12-2010), windin (13-02-2012)
Links Patrocinados
 

Search Engine Optimization by vBSEO 3.3.0