/// <summary>
        /// Builds a script that will insert data from the specified <see cref="LogTableRecord" />.
        /// </summary>
        /// <param name="table">The <see cref="LogTableDefinition" /> for the database table.</param>
        /// <param name="record">The <see cref="LogTableRecord" /> containing the data to insert.</param>
        /// <returns>A <see cref="SqlCommand" /> for an INSERT script that inserts the data from the specified <see cref="LogTableRecord" />.</returns>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="table" /> is null.
        /// <para>or</para>
        /// <paramref name="record" /> is null.
        /// </exception>
        public static SqlCommand BuildInsert(LogTableDefinition table, LogTableRecord record)
        {
            if (table == null)
            {
                throw new ArgumentNullException(nameof(table));
            }

            if (record == null)
            {
                throw new ArgumentNullException(nameof(record));
            }

            SqlParameterHelper helper = new SqlParameterHelper(table, record);

            StringBuilder script = new StringBuilder();

            script.Append($"INSERT INTO [dbo].[{table.Name}](");
            script.Append(string.Join(", ", helper.GetColumnNames()));
            script.Append(") VALUES (");
            script.Append(string.Join(", ", helper.GetColumnParams()));
            script.Append(")");

            // Add parameters for all values
            SqlCommand command = new SqlCommand(script.ToString());

            command.Parameters.AddRange(helper.GetSqlParameters().ToArray());
            return(command);
        }