如何得到一张表的表结构?

fantasyboy 2003-05-15 08:35:20
请问如何得到sql server数据库其中一张表的表结构脚本?

谢谢!
...全文
68 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
swayi21 2003-05-15
  • 打赏
  • 举报
回复
exec sp_columns tAttendance
foreveryday007 2003-05-15
  • 打赏
  • 举报
回复
//TTable,TTQuery
for i := 0 to FieldDefs.Count - 1 do
begin
sTmp := FieldDefs.Items[i].Name;//DataType,Size,Required
dingzhongfeng 2003-05-15
  • 打赏
  • 举报
回复
select b.name AS 字段,
c.name as 数据类型 ,
b.length as 长度,
case b.isnullable when 0 then 'not null' when 1 then 'null'end as 是否为空
from sysobjects a,syscolumns b,systypes c
where a.name='表名' and a.id = b.id and b.usertype=c.usertype
order by colid
zhaojiansheng 2003-05-15
  • 打赏
  • 举报
回复
SELECT b.*
FROM sysobjects a,syscolumns b
where a.id=b.id
and a.name='表名'




goldencity 2003-05-15
  • 打赏
  • 举报
回复
sp_help TableName

2,496

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧