This is because, in the SQL table, TableId field doesn't exist on the actual table but rather it is held in SQLDictionary and few other SYS tables.
So the workaround is to create a computed column in View as below:
In Union View, BranchNum gives the table number from the Union query. The corresponding SQL View definition looks like:
SELECT T1.ACCOUNTNUM AS ACCOUNTNUM, T1.DATAAREAID AS DATAAREAID, T1.PARTITION AS PARTITION, 1010 AS RECID, (CAST(('CustTrans') AS NVARCHAR(10))) AS TABLE_
FROM CUSTTRANS T1
UNION
SELECT T1.ACCOUNTNUM AS ACCOUNTNUM, T1.DATAAREAID AS DATAAREAID, T1.PARTITION AS PARTITION, 1010 AS RECID, (CAST(('VendTrans') AS NVARCHAR(10))) AS TABLE_
FROM VENDTRANS T1

Like
Report
*This post is locked for comments