Dave Amour
Dave Amour

Reputation: 165

Missing Index Sysname

When I used SQL Server Management Studio to display the estimated execution plan of a query it will sometimes suggest a missing index.

My question is about the sysname in the following suggestion - What does sysname mean?

I would normally just replace the firstline with CREATE NONCLUSTERED INDEX [IX_Users_Surname] so I don't understand the sysname reference.

CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>]
ON [dbo].[Users] ([Surname])
INCLUDE ([UserID],[Firstname],[Email],[Password])

Upvotes: 4

Views: 2623

Answers (1)

Remus Rusanu
Remus Rusanu

Reputation: 294317

The <name, type> syntax is for the SSMS template replacement dialog, see Replace Template Parameters:

To use this dialog box, you must have parameters in your script enclosed in angle brackets (< >) in the format <parameter_name, data_type, default_value>.

Therefore sysname is the type of the index name template parameter, and sysname is the appropriate type.

Upvotes: 5

Related Questions