Skip to content

Commit

Permalink
Remover duplicidade
Browse files Browse the repository at this point in the history
Ajuste para remover duplicidade quando a tabela estiver particionada.
  • Loading branch information
luizvitorf committed Jun 2, 2020
1 parent 9660ca7 commit 4c3bbf3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ where o.name = @Nm_Tabela
GROUP BY i.[name]
ORDER BY 2 desc

-- OBS: O DISTINCT É UTILIZADO PARA REMOVER A DUPLICIDADE
IF(OBJECT_ID('tempdb..#Temp_Compression') IS NOT NULL) DROP TABLE #Temp_Compression

select i.name,data_compression_desc
select distinct i.name, data_compression_desc
into #Temp_Compression
FROM [sys].[partitions] AS [p]
INNER JOIN sys.tables AS [t]
Expand Down

0 comments on commit 4c3bbf3

Please sign in to comment.