zoukankan      html  css  js  c++  java
  • 用sql 语句给字段添加描述

    用sql 语句给字段添加描述
    IF not exists
    (SELECT * FROM ::fn_listextendedproperty (NULL, 'user', 'dbo', 'table', 'strTableName', 'column', ''strColumnName''))
    BEGIN
    exec sp_addextendedproperty
    'MS_Description', 'strColumnDesc ', 'user', 'dbo', 'table','strTableName', 'column', 'strColumnName'
    END
    ELSE

    BEGIN
    exec sp_updateextendedproperty 'MS_Description', 'strColumnDesc ', 'user', 'dbo', 'table','strTableName', 'column', 'strColumnName'
    END

    用sql语句查询字段描述
    SELECT * FROM ::fn_listextendedproperty
    (null,'user','dbo','table','APPL_CREDIT','column',null)


    用sql语句删除字段描述
    EXEC sys.sp_dropextendedproperty
    'MS_Description' ,'user','dbo','table','APPL_CREDIT','column','APPLNO'


    1> sql server 怎么查询数据字段说明?
    可以在extended_properties视图中进行查看:
    sql:SELECT * FROM sys.extended_properties WHERE major_id = OBJECT_ID ('TABLENAME' );
    解释:以上语句就是从视图中获取到对象的所有描述信息。并且表名必须用大写(TABLANAME换成相应的表名)

    111111
  • 相关阅读:
    TensorRT推理加速基于Tensorflow(keras)的uff格式模型(文件准备)
    pandas_format06
    docker01
    pandas_dataformat03
    pandas_dataformat02
    pandas_series04
    pandas_format05
    pandas_format04
    pandas_dataframe01
    pandas_series03
  • 原文地址:https://www.cnblogs.com/whl4835349/p/5690808.html
Copyright © 2011-2022 走看看