ITPub博客

首页 > IT职业 > IT职场 > sql 2000 字段查询修正

sql 2000 字段查询修正

IT职场 作者:adder 时间:2021-09-09 09:14:29 0 删除 编辑
internal static string GetTableColumns2000()
        {
            sqlText.Remove(0, sqlText.Length);
            sqlText.Append("select s1.name as ColumnName,case s2.name when 'nvarchar' then s1.[prec] else s1.[length] end  as [MaxSize],");
            sqlText.Append("isnullable as [IsNullable],colstat as [ReadOnly],s2.name as [SqlType] ,isnull(s3.[value],'no description') as description ");
            sqlText.Append("from syscolumns s1 right join systypes s2 on s2.xusertype =s1.xusertype  ");//修正有变化
            sqlText.Append("left join sysproperties s3 on  (s3.id=s1.id and s3.smallid = s1.colid)");//修正有变化
            sqlText.Append("where s1.id=object_id(@TableName)  and s2.name'sysname' order by ReadOnly desc  ");//修正有变化
            //sqlText.Append("select substring(@@Version, 25,1)  ");
            return sqlText.ToString();
        }

 

记录了:
9:OutPutData 数据库2000输出屏蔽系统自带的[表/视图/存储过程]

string sql2000 = "select name from sysobjects where status>0 and xtype='" + tableType.ToString() + "'";


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1595/viewspace-2800987/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-15

  • 博文量
    110
  • 访问量
    724