|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
SR0004: Avoid using columns that do not have indexes as test expressions in IN predicates
In this example, a simple SELECT statement references a column, [c1], that did not have an index. The second statement defines an index that you can add to resolve this warning.
CREATE PROCEDURE [dbo].[Procedure3WithWarnings] AS SELECT [Comment] FROM [dbo].[Table2] WHERE [c1] IN (1, 2, 3) CREATE INDEX [IX_Table2_C1] ON [dbo].[Table2] (c1);