Force Table Scan in SQL Server/Sybase

When extracting whole tables or large recordsets (say, at least 80% of the table), it is better to use Full Table Scan than use index. Full scan is more efficient in this case because it no longer need to search through the index for each record. It doesn’t need to because the whole table is going to be extracted anyways.
[Read more...]

Incoming search terms:

  • sql server force table scan
  • sql server force full table scan
  • FORCE TABLE SCAN
  • sql server table scan force
  • table scan in sql server
  • sybase forceindex
  • sql server full table scans
  • Sybase Table Scan vs Index
  • sql server select force table scan
  • sql server table scan

How To Determine SQL Server Version

In case you need to know what version of SQL Server you are currently using, you can use the queries below.

Starting at SQL Server 2000, you can use the following query.

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

The above query is applicable for SQL Server 2000, SQL Server 2005 and SQL Server 2008. For SQL Server 7 and SQL Server 6.5 series. The code below should be used.

SELECT @@VERSION

If you are not sure what version of SQL Server you have, use the second query. It still works as it isn’t deprecated yet. The new version is handy if you need to get the details programmatically.