• Equality and inequality columns are explained in the Microsoft documentation for sys.dm_db_missing_index_details

    http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k%28SYS.DM_DB_MISSING_INDEX_DETAILS_TSQL%29;k%28SQL11.SWB.TSQLRESULTS.F1%29;k%28SQL11.SWB.TSQLQUERY.F1%29;k%28MISCELLANEOUSFILESPROJECT%29;k%28DevLang-TSQL%29&rd=true

    equality_columns

    nvarchar(4000)

    Comma-separated list of columns that contribute to equality predicates of the form:

    table.column =constant_value

    inequality_columns

    nvarchar(4000)

    Comma-separated list of columns that contribute to inequality predicates, for example, predicates of the form:

    table.column > constant_value

    Any comparison operator other than "=" expresses inequality.

    Using Missing Index Information in CREATE INDEX Statements

    To convert the information returned by sys.dm_db_missing_index_details into a CREATE INDEX statement, equality columns should be put before the inequality columns, and together they should make the key of the index. Included columns should be added to the CREATE INDEX statement using the INCLUDE clause. To determine an effective order for the equality columns, order them based on their selectivity: list the most selective columns first (leftmost in the column list).

    So you should create the index based on equality columns, then inequality (if any) and add an INCLUDE statement for columns that can be returned but do not participate in the seek operation.

    You should have a look at Brent Ozar's implementation of the same thing, but it generates the T-SQL based on the a similar query to yours.

    http://www.brentozar.com/blitzindex/