Bruno's profileBruno Velaz - SharePoint...PhotosBlogListsMore ![]() | Help |
|
November 23 Querys Úteis SQL SERVEREstou colocando alguns scripts que acho seria interesante todos terem.
/* GERA DICIONÁRIO DE DADOS */SET NOCOUNT ON DECLARE @Id_Tabela int, @Nome_Tabela varchar(50)
PRINT 'BANCO DE DADOS: ' + UPPER(db_name()) PRINT '' DECLARE tabelas CURSOR FOR SELECT Name, ID FROM sysobjects WHERE xtype = 'U' AND Name <> 'dtProperties' ORDER BY Name OPEN tabelas FETCH NEXT FROM tabelas INTO @Nome_Tabela, @Id_Tabela WHILE @@FETCH_STATUS = 0 BEGIN IF(UPPER(@nome_tabela)<>'SYSPROPERTIES') BEGIN PRINT 'TABELA: ' + UPPER(@nome_tabela) select nome_campo = LEFT(RTRIM(LTRIM(sc.name)),40), tipo_campo = LEFT(RTRIM(LTRIM(st.name)),20), tamanho_campo = sc.length, descricao_campo = ISNULL(sp.name,'') FROM syscolumns sc, systypes st, sysobjects sp WHERE sc.id = @Id_Tabela AND sc.xtype = st.xtype and sc.colid *= sp.id and sp.id = @Id_Tabela ORDER BY sc.colid
PRINT '' FETCH NEXT FROM tabelas INTO @Nome_Tabela, @Id_Tabela END END CLOSE tabelas DEALLOCATE tabelas SET NOCOUNT OFF
/* VERIFICA PROCESSOS BLOQUEADOS NO SQL SERVER */ select spid, blocked, hostname=left(hostname,20), program_name=left(program_name,20),WaitTime_Seg = convert(int,(waittime/1000)) ,open_tran, status from master.dbo.sysprocesses where blocked = 0 and SPID in (Select blocked from master.dbo.SYSPROCESSES where blocked >0 ) order by spid
/* Script para Listar o tamanho dos objetos do TIPO Table no banco*/
|
| 1. | Examine o arquivo Upgrade.log para determinar o caminho incluído que está faltando. | ||||||||||||||
| 2. | Adicionar um caminho incluído. Para fazer isto, execute as seguintes etapas::
Buenas suerte!!! Gracias a todos.
|
Valew galera.
Abraços
|
|