diff --git a/uppsrc/TSql/util.cpp b/uppsrc/TSql/util.cpp index bded3ebf9..a9657fc65 100644 --- a/uppsrc/TSql/util.cpp +++ b/uppsrc/TSql/util.cpp @@ -577,6 +577,11 @@ SqlVal SchemaAlias(const SqlVal& table) return SqlCol(~SchemaTable(table) + SqlCase(MSSQL, " as ")(" ") + ~table); } +SqlId SchemaId(SqlId table_id) +{ + return SqlId(SchemaTableName(~table_id) + SqlCase(MSSQL, " as ")(" ") + ~table_id); +} + VectorMap Describe(const SqlVal& table, Sql& cursor) { VectorMap map; diff --git a/uppsrc/TSql/util.h b/uppsrc/TSql/util.h index 2cddcf0f0..7e62eb08b 100644 --- a/uppsrc/TSql/util.h +++ b/uppsrc/TSql/util.h @@ -89,6 +89,7 @@ bool IsNotSchemaEmpty(const SqlVal& table, SqlId column, const SqlVal Alias(const SqlVal& value, const SqlVal& alias); SqlVal SchemaAlias(const SqlVal& table, const SqlVal& alias); SqlVal SchemaAlias(const SqlVal& table); +SqlId SchemaId(SqlId table); inline SqlInsert InsertSchema(SqlId table) { return SqlInsert(SqlId(SchemaTableName(~table))); } inline SqlUpdate UpdateSchema(SqlId table) { return SqlUpdate(SqlId(SchemaTableName(~table))); }