/// <summary>
        /// Gets the next value of a table native sequence.
        /// </summary>
        /// <param name="transaction"></param>
        /// <param name="tableName"></param>
        /// <returns>
        /// Returns the next value of the sequence for the given table.
        /// </returns>
        public static SqlNumber NextTableId(this ITransaction transaction, ObjectName tableName)
        {
            transaction.AssertNotReadOnly();

            var tableManager = transaction.GetTableManager();

            if (tableManager == null)
            {
                throw new InvalidOperationException();
            }

            return(tableManager.NextUniqueId(tableName));
        }