private void SetEmbeddedDocuments(SqlMigrationDocument document, SqlTable parentTable)
        {
            foreach (var childTable in parentTable.EmbeddedTables)
            {
                var parentValues = GetValuesFromColumns(parentTable.GetReader(), parentTable.PrimaryKeys);

                var childColumns = childTable.GetColumnsReferencingParentTable();

                SqlReader childReader;

                if (childColumns.Count > parentTable.PrimaryKeys.Count || parentTable.IsEmbedded)
                {
                    childReader = childTable.GetReaderWhere(parentValues);
                }

                else
                {
                    childReader = childTable.GetReader();
                }

                if (childReader.HasValue() == false && childReader.Read() == false)
                {
                    continue;
                }

                var continueLoop = false;

                while (CompareValues(parentValues, GetValuesFromColumns(childReader, childColumns), out var isBigger) == false)
                {
                    if (isBigger == false && childReader.Read())
                    {
                        continue;
                    }

                    continueLoop = true; // If parent value is greater than child value => childReader move to next, otherwise, parentReader move to next
                    break;
                }

                if (continueLoop)
                {
                    continue;
                }

                do
                {
                    var innerDocument = FromReaderInternal(childReader, childTable);

                    document.Append(childTable.NewName, innerDocument);

                    if (childReader.Read() == false)
                    {
                        break;
                    }
                } while (CompareValues(parentValues, GetValuesFromColumns(childReader, childColumns), out _));
            }
        }
        private void SetEmbeddedDocuments(SqlMigrationDocument document, SqlTable parentTable)
        {
            foreach (var childTable in parentTable.EmbeddedTables)
            {
                var parentValues = GetValuesFromColumns(parentTable.GetReader(), parentTable.PrimaryKeys); // values of referenced columns

                var childColumns = childTable.GetColumnsReferencingParentTable();                          // values of referencing columns

                SqlReader childReader;

                if (childColumns.Count > parentTable.PrimaryKeys.Count || parentTable.IsEmbedded)
                {
                    childReader = childTable.GetReaderWhere(parentValues); // This happens in a case when we can not iterate the embedded table only once and have to use multiple queries.
                }
                else
                {
                    childReader = childTable.GetReader();
                }

                if (childReader.HasValue() == false && childReader.Read() == false)
                {
                    continue;
                }

                var continueLoop = false;

                while (CompareValues(parentValues, GetValuesFromColumns(childReader, childColumns), out var isBigger) == false)
                {
                    if (isBigger == false && childReader.Read())
                    {
                        continue;
                    }

                    continueLoop = true; // If parent value is greater than child value => childReader move to next. Otherwise => parentReader move to next
                    break;
                }

                if (continueLoop)
                {
                    continue;
                }

                do
                {
                    var innerDocument = FromReaderInternal(childReader, childTable);

                    document.Append(childTable.NewName, innerDocument);

                    if (childReader.Read() == false)
                    {
                        break;
                    }
                } while (CompareValues(parentValues, GetValuesFromColumns(childReader, childColumns), out _));
            }
        }