Granite WMS/SQL
外观
SET IDENTITY_INSERT tablename ON
SET IDENTITY_INSERT tablename OFF
SET STATISTICS IO ON
SET STATISTICS TIME ON
select * from sys.triggers
select [definition] from sys.sql_modules m
inner join sys.objects obj on obj.object_id=m.object_id
where obj.type ='TR'
EXEC sp_msforeachtable "ALTER TABLE ? DISABLE TRIGGER ALL"
右键单击 SQL 实例 打开活动监视器 点击进程
有用的查询
declare @id bigint --id to loop
select @id = min(id) from OptionalFields where AppliesTo = 'MASTERITEM' --example get all optional fields for masteritems
while @id is not null
begin
--do your thing insert update
insert into OptionalFieldValues_MasterItem(Belongsto_id, OptionalField_id)
select ID, @id from MasterItem;
--get next id
select @id = min(id) from OptionalFields where ID > @id
end