Exemple #1
0
        /// <summary>
        /// Returns string with CREATE TABLE sql for the table which owns this index.
        /// </summary>
        /// <param name="connection">Connection to use to execute query.</param>
        /// <param name="row">DataRow with information about index.</param>
        /// <returns>Returns string with CREATE TABLE sql for this table.</returns>
        private static string GetCreateTableQuery(DataConnectionWrapper connection, DataRow row)
        {
            // Extract schema and table name
            string schemaName = DataInterpreter.GetString(row, Attributes.Schema);
            string tableName  = DataInterpreter.GetString(row, Attributes.Table);

            if (String.IsNullOrEmpty(schemaName) || String.IsNullOrEmpty(tableName))
            {
                Debug.Fail("Unable to get table or schema name");
                return(String.Empty);
            }

            return(TableDescriptor.GetCreateTableQuery(connection, schemaName, tableName));
        }