Getting Started #
The Load Table feature allows you to take a provided SQL Statement and load it as a TAD Table for importing, updating, or analyzing data.
This is typically used when a custom SQL query has been provided to you for use in TAD.
A sample SQL Statement is provided at the bottom of this article using the TAD Sandbox table, which all users have access to by default.
Loading a Table #
Click the Add Table button on the left side of the ribbon.

Click the Query button on the left side of the window.

Paste the SQL Statement into the SQL Statement field.
Click the Load SQL button to process the query.

You will see a confirmation message stating that the table has been successfully loaded into TAD.

The SQL Statement field will be updated to display only the SQL query, and the various sections on the left side (such as Select, From, Join, Where, etc.) will be automatically populated based on the statement structure.

Change the Tab Name if needed.
Click Download Changes to apply the updates and retrieve the data.

If you’re using the sample SQL Statement or one that includes parameters, the TAD Parameters form will appear.
Click the Download button to proceed with retrieving the data.

You will see the records in the Table, along with the blue action buttons that guide your workflow for importing, updating, or analyzing data.

HQ Company Join #
If Company data security is active in Vista, the HQCO table must be included in every SQL Statement to ensure proper data security.
If the SQL Statement you load does not already contain the HQCO table, it will be automatically added to ensure compliance with security rules.
The statement below does not contain the HQCO table, and as a result, it will be added automatically.

When you click the Load SQL button, you will receive the following message indicating that the HQCO table has been automatically added to the SQL Statement for security purposes.

The statement below now contains the HQCO table, ensuring that company data security is properly applied.

Sample SQL Statement #
You can use the code below to load the TAD Sandbox as a Table.
/*Package:Download,Validate Import,Execute Import*/
/*Parameters:(Companies):udTADSandbox.Co*/
DECLARE @(Companies) varchar(100); SET @(Companies)=''
SELECT udTADSandbox.Co, udTADSandbox.Seq, udTADSandbox.State, udTADSandbox.BudgetAmt, udTADSandbox.KeyID
FROM udTADSandbox
INNER JOIN HQCO HQCompany ON udTADSandbox.Co=HQCompany.HQCo
WHERE (udTADSandbox.Co IN (@(Companies)) OR LEN(@(Companies))=0)