Hi friends,
With a need for the first time to check if a PK and an Index exists before dropping and re-creating the same need your help.
IF OBJECT_ID(N'PK_LMT', N'PK') IS NOT NULL SELECT 1 (does not work and reflects Command(s) completed successfully)
IF OBJECT_ID('PK_LMT', 'PK') IS NOT NULL SELECT 1 (does not work and Command(s) completed successfully)
While:
SELECT * FROM SYS.objects WHERE NAME = 'PK_LMT' (does reflect the same)
Similarly how to check if an index (named IX_LGUF_DT_CUST) exists? Is it only to check from sys.indexes?
Thanks for all your help.