Tuning the database depends on many factors and can differ based on the database engine being used however one important point remains the same, the design, if a database is badly designed then you may as well forget about optimisation and tuning.
Check out WWW.SQL-Server-Performance.com
Matt
To do this you will need to build the SQL statement into a variable then execute that variable for it to work
declare @SQLStatement varchar(1000)
set @SQLStatement = "
SELECT TOP "+@NumberRecs+" contributor,hits
FROM #UserList
WHERE contributor != 5
Order by hits DESC"...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.