-- Add non unique index for a single field
IF NOT EXISTS (SELECT * FROM sysindexes WHERE name = 'inu_TTTTT_FFFFFF')
CREATE INDEX inu_TTTTT_FFFFFF ON TTTTT(FFFFFF)
--------------------------------------------------------------------------------------------------
-- Add clustered non unique index for a single field
IF NOT EXISTS (SELECT * FROM sysindexes WHERE name = 'inu_TTTTT_FFFFFF')
CREATE CLUSTERED INDEX inu_TTTTT_FFFFFF ON TTTTT(FFFFFF)
--------------------------------------------------------------------------------------------------
-- Add unique index for a single field
IF NOT EXISTS (SELECT * FROM sysindexes WHERE name = 'iun_TTTTT_FFFFFF')
CREATE UNIQUE INDEX iun_TTTTT_FFFFFF ON TTTTT(FFFFFF)
--------------------------------------------------------------------------------------------------
-- Add unique index for a combination of two fields
IF NOT EXISTS (SELECT * FROM sysindexes WHERE name = 'iun_TTTTT_FFFFFF_GGGGGG')
CREATE UNIQUE INDEX iun_TTTTT_FFFFFF_GGGGGG ON TTTTT(FFFFFF, GGGGGG)
--------------------------------------------------------------------------------------------------
IF NOT EXISTS (SELECT * FROM sysindexes WHERE name = 'inu_TTTTT_FFFFFF')
CREATE INDEX inu_TTTTT_FFFFFF ON TTTTT(FFFFFF)
--------------------------------------------------------------------------------------------------
-- Add clustered non unique index for a single field
IF NOT EXISTS (SELECT * FROM sysindexes WHERE name = 'inu_TTTTT_FFFFFF')
CREATE CLUSTERED INDEX inu_TTTTT_FFFFFF ON TTTTT(FFFFFF)
--------------------------------------------------------------------------------------------------
-- Add unique index for a single field
IF NOT EXISTS (SELECT * FROM sysindexes WHERE name = 'iun_TTTTT_FFFFFF')
CREATE UNIQUE INDEX iun_TTTTT_FFFFFF ON TTTTT(FFFFFF)
--------------------------------------------------------------------------------------------------
-- Add unique index for a combination of two fields
IF NOT EXISTS (SELECT * FROM sysindexes WHERE name = 'iun_TTTTT_FFFFFF_GGGGGG')
CREATE UNIQUE INDEX iun_TTTTT_FFFFFF_GGGGGG ON TTTTT(FFFFFF, GGGGGG)
--------------------------------------------------------------------------------------------------
No hay comentarios:
Publicar un comentario