SQL Server中的索引增量 [英] index increment in sql server

查看:102
本文介绍了SQL Server中的索引增量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SQL Server 2008作为数据库.每当在表中插入或更新记录时,我都必须手动增加索引.为此,我首先使用select从表中搜索索引,然后将其递增1并更新表中的记录,因此我怀疑何时再当时通过LAN或WAN连接了10台PC以更新或插入记录,这是否可行?还有其他方法吗?

i am using sql server 2008 for the database. i have to increment index manually whenever record is inserted or updated in table.for this first i search for the index from the table using select after this increment it by 1 and update the record in the table,so i have doubt that when more then 10 pc are connected via LAN or WAN at that time for updating or inserting record this will be work or not ? any other way to do this ?

推荐答案

您可以设置自动增量:查看列定义并找到属性"Identity Specification"
展开它,然后将(Is Identity)"设置为是"
You can set an automatic increment: Look at the column definition and find the property "Identity Specification"
Expand it, and set "(Is Identity)" to "Yes"


您可以使用IDENTITY [(seed,increment)]属性

参考:身份(属性) [
You can use IDENTITY [ ( seed , increment ) ] Property

Refer: IDENTITY (Property)[^]


这篇关于SQL Server中的索引增量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆