mudar nome da tabela...
Gostaria de saber como faço para mudar via sql o nome de uma tabela no firebird, tipo:
Tabela: TblClientes
Mudar para
Clientes
Tabela: TblClientes
Mudar para
Clientes
Thiagopedro
Curtidas 0
Melhor post
Marcelo.l
29/03/2005
Acredito que não tenha como. (Colegas, me corrijam se eu estiver errado... )
O que pode ser feito é :
1 - Voce criar uma nova tabela com o nome desejado e a mesma estrutura da outra tabela;
2 - Transferir os dados da tabela antiga para a nova e depois;
3- Dar um ´Drop´ na tabela antiga.
Tudo via SQL.
Espero ter ajudado.
O que pode ser feito é :
1 - Voce criar uma nova tabela com o nome desejado e a mesma estrutura da outra tabela;
2 - Transferir os dados da tabela antiga para a nova e depois;
3- Dar um ´Drop´ na tabela antiga.
Tudo via SQL.
Espero ter ajudado.
GOSTEI 1
Mais Respostas
Thiagopedro
29/03/2005
Colega a sua dica é muito válida, só gostaria de saber se existe um aplicativo que converte os dados armazenados um uma query tipo de insert dos próprios dados com os respectivos campos.
GOSTEI 0
Andre Oliveira
29/03/2005
Funciona... eu testei...
UPDATE RDB$RELATIONS
SET RDB$RELATION_NAME='NOVO_NOME' where
RDB$RELATION_NAME='NOME_ANTIGO';
UPDATE RDB$RELATION_FIELDS
SET RDB$RELATION_NAME='NOVO_NOME' where
RDB$RELATION_NAME='NOME_ANTIGO' and
RDB$SYSTEM_FLAG=0;
UPDATE RDB$RELATIONS
SET RDB$RELATION_NAME='NOVO_NOME' where
RDB$RELATION_NAME='NOME_ANTIGO';
UPDATE RDB$RELATION_FIELDS
SET RDB$RELATION_NAME='NOVO_NOME' where
RDB$RELATION_NAME='NOME_ANTIGO' and
RDB$SYSTEM_FLAG=0;
GOSTEI 1