3 ms·
Here's some one's you can do in SQL Server and probably easily attain that in your garbage code: 1. Remove table variables, use temp tables. 2. Remove user def
by hobs 6y ago
Here's some one's you can do in SQL Server and probably easily attain that in your garbage code:
1. Remove table variables, use temp tables.
2. Remove user defined functions from your predicate if its job is to return the same fixed subset, insert that into a temp table.
The first one can be done by effectively changing an @ to a # and mildly changing the create statements (from declare to create) - doing just this change I took a a 22+ hour long query(didnt want to wait any longer) to a <1 minute query.