How do I get to export blank tables (i.e. just the headers) as well as tables containing data. The reason for the blank table is my customer wants to import the table structure i.e. the headers so it can be used in the future if needed. 

When I follow the solution on: [Exporting data from multiple SQL tables to different flat files using SSIS Script Task](https://stackoverflow.com/questions/6216486/exporting-data-from-multiple-sql-tables-to-different-flat-files-using-ssis-scrip) I get the below error: 

> 
> Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at ST\_97b3989b700a41f1ad54fb2abd27b891.vbproj.ScriptMain.Main() --- End of inner exception stack trace --- at System.RuntimeMethodHandle.\_InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
> 
> 
>