zoukankan      html  css  js  c++  java
  • [Database] SqlServer: Sql Server中记录的用户信息

      昨天写数据库文档时想把某个表中的字段名、类型、长度copy到excl中,可是sql server中不能直接copy,想到数据库中用户做的操作在系统表中都有记录。sysobjects表中存放所有的表名信息、syscolumns存放所有字段名属性信息、systypes存入的是数据类型信息。

    (下面以表名zztxx为例查询)

    1sql中查出用户的表名

    select name from sysobjects where xtype='U'

    2sql中查出用户表字段的所有属性

    select * from syscolumns where id=object_id('zztsxx')

    3sql中查出用户表字段名、字段类型名、长度

    select syscolumns.name,systypes.name,syscolumns.length from syscolumns,systypes where (syscolumns.id=object_id('zztsxx') and syscolumns.xtype=systypes.xtype) order by syscolumns.colorder

  • 相关阅读:
    mybatis plus 执行sql
    springboot 打印 mybatisplus 的sql
    easyexcel 简单使用
    springboot ehcache
    easyexcel 时间转换
    springboot stopwatch
    c# 开机自动启动
    sqlHelper
    DirectX录音
    c# 发邮件
  • 原文地址:https://www.cnblogs.com/abeen/p/250653.html
Copyright © 2011-2022 走看看