如何从一表中获取其增量字段?

itcai 2006-03-16 05:28:02
怎么样获取表的增量字段?急!急!急!
...全文
186 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
itcai 2006-03-17
  • 打赏
  • 举报
回复
TO;zjcxc(邹建)
那还有其它的获取方法吗?
zjcxc 2006-03-16
  • 打赏
  • 举报
回复
autoval varbinary(255) 仅限内部使用。

所以一般还是不要用这个做判断的好.
zjcxc 2006-03-16
  • 打赏
  • 举报
回复
status tinyint 用于描述列或参数属性的位图:
0x08 = 列允许空值。
0x10 = 当添加 varchar 或 varbinary 列时,ANSI 填充生效。保留 varchar 列的尾随空格,保留 varbinary 列的尾随零。
0x40 = 参数为 OUTPUT 参数。
0x80 = 列为标识列。
zjcxc 2006-03-16
  • 打赏
  • 举报
回复
select [name] from syscolumns
where id=object_id('表名') and status & 0x80 = 0x80
lsqkeke 2006-03-16
  • 打赏
  • 举报
回复
select [name] from syscolumns
where id=object_id('表名') and autoval is not null
WangZWang 2006-03-16
  • 打赏
  • 举报
回复
select name as 增量列名 from syscolumns
where id=object_id('表名') and autoval is not null
huailairen 2006-03-16
  • 打赏
  • 举报
回复

select '表名', name from syscolumns where id=object_id('表名') and autoval is not null
viptiger 2006-03-16
  • 打赏
  • 举报
回复
select * from syscolumns where autoval is not null

22,210

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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