Tag Archives: banco de dados

Comparar Tabelas Banco de Dados SQL Server

Comparando as estruturas de todas as tabelas de dois bancos de dados diferentes no SQL Server [sql] use Banco1 SELECT CONCAT(t.name, ‘.’, c.name, ‘ (‘, tp.name, ‘, ‘, c.length, ‘, ‘, c.isnullable, ‘)’) TabelaCampoTipoTamanhoNull, t.name Tabela, c.name Campo, tp.name Tipo, c.length Tamanho, c.isnullable PerniteNull into #EstruturaA FROM SYSCOLUMNS c inner join SYSOBJECTS t on t.id […]

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> SQL | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> , , | Leave a comment

Criar tabela com base em Select MySQL

Por vezes temos a necessidade de criar uma tabela “física” com base em um select, são diversos os motivos um deles é a organização das tabelas do nosso banco. Para tal realize a ação abaixo [sql] CREATE TABLE nome-da-tabela SELECT * FROM tabela-atual [/sql] Obs: lembre-se sempre que o “* from” não é uma boa […]

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> MySQL | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> , , , | Leave a comment