免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2227 | 回复: 2
打印 上一主题 下一主题

请教关于identity的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-06-06 15:12 |只看该作者 |倒序浏览
1: 大家都知道一个表有identity字段的话,会在内存中保存一个identity值段,我们叫burning gap或者identity_gap什么的,问题是怎么看当前内存中使用到了哪个呢?比如存放了1-5000的话,当前值是多少呢?
2: 大家知道identity_insert设置成on是为了往表中插入指定的identity值用的,问题是我们怎么知道现在identity_insert值是on呢还是off呢?
3:怎么查看所有现在这个session中set所有参数的值?

谢谢了!

论坛徽章:
0
2 [报告]
发表于 2006-06-06 16:33 |只看该作者
1、select @@indentity
2、不知道
3、不知道

论坛徽章:
0
3 [报告]
发表于 2006-06-07 10:11 |只看该作者
For question 2:
Create a dummy table and try to turn on identity_insert for the dummy table - if identity_insert is already on for the session, the resulting error message will identify the table.

1> create table test (x numeric(12,0) identity)
2> go
1> create table dummy (x numeric(12,0) identity)
2> go
1> set identity_insert test on
2> go
1> set identity_insert dummy on
2> go

Unable to 'SET IDENTITY_INSERT' for table 'dummy' because IDENTITY_INSERT or IDENTITY_UPDATE is already ON for the table 'test' in database 'tempdb'.

You can also use dbcc pss to find it.

For question 3: sp_configure
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP