When you create a saved query to use as the source in a synchronization task, the SQL statement must be a SELECT statement.
uses the SQL statement to retrieve source column information. You can edit the data type, precision, or scale of each column before you save the saved query.
For example, you might create a saved query based on a TRANSACTIONS table that includes transactions from 2016 with the following SQL statement:
SELECT TRANSACTION_ID, TRANSACTION_TOTAL, TRANSACTION_TIMESTAMP from dbo.TRANSACTIONS WHERE TRANSACTION_TIMESTAMP>’0:0:0:0 01/01/2016’
ensures that saved query column names are unique. If an SQL statement returns a duplicate column name,
adds a number to the duplicate column name as follows: