SVN r1126
SVN-Revision: r1126
This commit is contained in:
@@ -1299,6 +1299,30 @@ namespace Lskj.Business.Impl
|
|||||||
public static string GetAutogrowcolumn(string tableName)
|
public static string GetAutogrowcolumn(string tableName)
|
||||||
{
|
{
|
||||||
string sqlvalue = $@"SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.columns
|
string sqlvalue = $@"SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.columns
|
||||||
WHERE TABLE_NAME = '{0}' AND COLUMNPROPERTY(OBJECT_ID('{tableName}'),COLUMN_NAME,'IsIdentity')= 1;";
|
WHERE TABLE_NAME = '{tableName}' AND COLUMNPROPERTY(OBJECT_ID('{tableName}'),COLUMN_NAME,'IsIdentity')= 1;";
|
||||||
if (SqlHelper.ConnectionType == ConnectionType.DmServer)
|
if (SqlHelper.ConnectionType == ConnectionType.DmServer)
|
||||||
|
{
|
||||||
|
sqlvalue = $@"select a.NAME from SYS.SYSCOLUMNS a,sysobjects b
|
||||||
|
where b.id = a.id and b.name = '{tableName}' and a.info2 = 1;";
|
||||||
|
}
|
||||||
|
return BaseImpl.GetResult(sqlvalue) + "";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取表格属性
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static DataTable GetDatabaseProperty(string tableName)
|
||||||
|
{
|
||||||
|
string sqlvalue = $@"select COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH from information_schema.columns
|
||||||
|
where table_name = '{tableName}';";
|
||||||
|
if (SqlHelper.ConnectionType == ConnectionType.DmServer)
|
||||||
|
{
|
||||||
|
sqlvalue = $@"SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH AS CHARACTER_MAXIMUM_LENGTH
|
||||||
|
FROM ALL_TAB_COLUMNS WHERE TABLE_NAME = '{tableName}';";
|
||||||
|
}
|
||||||
|
return BaseImpl.GetDataTableResult(sqlvalue);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user