解决方法
- create table test (Id int identity)
- go
- sp_help test
- The object 'test' does not have any indexes,or you do not have permissions.
- No constraints are defined on object 'test',or you do not have permissions.
作为一般做法,您将在您的身份列上创建一个唯一的索引,这样可以加快查找速度.
通常你也希望你的标识列是“聚集索引”(Id int identity主键是快捷方式),这意味着表以与您的标识列相同的顺序排列在磁盘上.这样优化了插入,因为插入的页面往往在内存中.在某些情况下,当您对表中的其他数据进行范围查找时,您可以考虑对其他列进行聚类,因为sql Server只允许每个表一个聚簇索引.