Posts Tagged ‘sargable’

Functions & sargable queries

Using functions improperly in your where clauses always prevents index usage right? I’ve been reviewing some queries generated by linq and I’ve found out this isn’t always the case. A quick demo… Create a temp tables and insert some data ?View Code TSQLCREATE TABLE #test ( id INTEGER NOT NULL PRIMARY KEY CLUSTERED, [name] VARCHAR(100) NOT NULL ); […]