Get-UpdatedTableFromReference.ps1

1
2
3
4
5
6
7
8
9
10
function Get-UpdatedTableFromReference($TableReference) {
    Write-Verbose "Looks like a joined DML statement, need to get into the references..."
    if ($TableReference.psobject.Properties["FirstTableReference"] -and $TableReference.FirstTableReference) {
        Get-UpdatedTableFromReference $TableReference.FirstTableReference
    } else {
        Write-Verbose "closing recursion..."
        Return $TableReference.SchemaObject
    }
}