Last active
May 12, 2021 22:03
-
-
Save donpandix/29088a8cd7cb34aba6056180b735c033 to your computer and use it in GitHub Desktop.
Creación de tablas temporales con indice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE #tabla_temporal ( | |
id_tabla BIGINT | |
,cd_columna_01 BIGINT | |
,gl_columna_02 | |
) | |
CREATE NONCLUSTERED INDEX idx_tabla_temporal ON #tabla_temporal ([id_tabla]) | |
-- Otras formas de definir indices | |
-- Indice no ordenado | |
CREATE INDEX idx_tabla_temporal ON #tabla_temporal (id_tabla); | |
-- Indice a partir de 2 columnas | |
CREATE UNIQUE INDEX idx_tabla_temporal ON #tabla_temporal (id_tabla asc, cl_columna_01 asc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment