This script file contains a sample benchmark that has the following:

 

 

Note:  This is sample code that isn't meant to be used in a production environment.  Nor does this imply that I'm recommending direct data access vs. SMO.  SMO allows the end user to not worry about direct SQL statements, and provides a handful of safeguards.  This code is merely meant to illustrate an optimization benchmark.