发布网友 发布时间:2022-05-01 05:49
共5个回答
懂视网 时间:2022-05-01 10:11
<summary> /// 获取数据库名称 /// </summary> /// <param name="Account">帐套号</param> /// <returns></returns> public static string GetDBName(string Account) { StringBuilder strSql = new StringBuilder(); strSql.Append(" select name from master..sysdatabases where name like‘%UFDATA_%‘ "); DataSet ds = DbHelperSQL.Query(strSql.ToString()); int count = ds.Tables[0].Rows.Count; string DbName = string.Empty; if (count > 0) { for (int i = 0; i < count; i++) { DbName = ds.Tables[0].Rows[i]["name"].ToString(); string TempDbName = DbName.Substring(7, 3); if (Account == TempDbName) { return DbName; } } } return DbName; }
获取数据库中指定类型的数据库名称
标签:
热心网友 时间:2022-05-01 07:19
select name from sysdatabases热心网友 时间:2022-05-01 08:37
select name from sysobjects where type='u'热心网友 时间:2022-05-01 10:11
白高兴了一场,我还以为有人会呢,人家要数据库的名称,你给出表名有什么用。热心网友 时间:2022-05-01 12:03
select * from master.dbo.sysdatabases