惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Security Affairs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Jina AI
Jina AI
P
Palo Alto Networks Blog
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
S
Schneier on Security
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
雷峰网
雷峰网
T
Tenable Blog
人人都是产品经理
人人都是产品经理
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
AWS News Blog
AWS News Blog
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Scott Helme
Scott Helme
SecWiki News
SecWiki News
C
CERT Recently Published Vulnerability Notes
Recorded Future
Recorded Future
I
InfoQ
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
Cloudbric
Cloudbric
C
Check Point Blog
Engineering at Meta
Engineering at Meta
TaoSecurity Blog
TaoSecurity Blog
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
腾讯CDC
量子位
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
Kaspersky official blog
Vercel News
Vercel News
F
Full Disclosure
T
Troy Hunt's Blog
Forbes - Security
Forbes - Security
S
Security @ Cisco Blogs

博客园 - ☆用心生活☆

BI-日期维度表-SQL SERVER SQL SERVER 2014 缺少Business Intelligence 解决办法 有未提交的事务。是否要在关闭窗口之前提交这些事务? 获取对象属性和值 日志记录 MSSQL之2005版本之后的行号分区妙用:row_number() over(PARTITION BY X1,X2.. ORDER BY X1,X2... ) IIS发布服务时候无法浏览,提示需要MIME注册 深浅COPY之我所理解,望拍砖交流。 windows developer preview 安装体验。 MSSQL之自增列丢失ID找回--粗略解决方案 datagirdview进行数据统计 水晶报表之分页预留空白方便打印信纸 DataGridView数据呈现之行信息--HitTestInfo--用于选择呈现第一行 SQLMETAL使用LINQ自动代码生成工具命令残参数详解 aspnet_compiler.exe 命令参数详解 妙用MSSQL的REVERSE()反转函数显示文件路径的文件名称 2011年上半年总结 windows phone 7 学习初旅1 MSSQL自定义函数之数据格式化为千分位格式 The product level is insufficient for component "Data Conversion 1"
MSSQL获取指定表的列名信息,描述,数据类型,长度
☆用心生活☆ · 2011-03-23 · via 博客园 - ☆用心生活☆

/*
--作用:根据特定的表名查询出字段,以及描述,数据类型,长度,精度,是否自增,是否为空等信息
--作者:wonder QQ:37036846 QQ群:.NET顶级精英群 ID:124766907

--时间:2011-03-23 11:25
--描述:创建存储过程
--参数:@tableName  表名
*/
CREATE PROC sp_GetListsColumnInfoByTableName(
@tableName nvarchar(255
))
AS

BEGIN


SELECT CASE  WHEN Q.INDID >=1 then '主键' ELSE '' END IS_KEYS,
x.objname
as ColumnName,x.value as
ColumnDescription,
z.name
as DataType,y.max_length as length ,y.precision
,y.scale,y.is_identity,y.is_nullable
FROM

(
SELECT *FROM ::fn_listextendedproperty (NULL,   'user ',   'dbo ',   'table ', @tableName,   'column ',   default)
)
AS
X
INNER JOIN

(
SELECT *FROM
  sys.all_columns
where object_id=(select object_id from sys.all_objects where name=@tableName
)
)
AS Y ON X.objname=
y.Name collate Chinese_PRC_CI_AS
inner join
sys.systypes Z
ON  Z.xusertype=
Y.user_type_id
left join (select *from  sysindexkeys where id=(select object_id from sys.all_objects where name=@tableName)) as
Q
ON Q.colid=
y.COLUMN_ID
order by
y.Column_id
END

测试存储过程:

EXEC sp_GetListsColumnInfoByTableName 'userInfo'