I have a SQL Servier database where I store schedules for multiple companies in a table called tblSchedules.
The primary key for this table is ScheduleRatesID
and auto increments.
Is there a way to have is increment from 700000 for Company A and 800000 for Company B?
您可以将它们放入两个不同的表中,然后使用视图将它们结合在一起...恐怕这是您唯一的选择。
我的建议是删除此表上的自动增量,并创建一个触发器来检查companyid,并且必须基于companyid计算并在指定的两个不同范围之间插入一个唯一的主键。
No. Identity does not work that way.
Sit down and write your own mechanism - it is not particularly hard.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.