1.删除所有表 select 'drop table '+name+';' from sys.tables where name like 'DataSyncV1DelaySample%' or name like 'DataSyncV2DelaySample%' 2.递归查询 使用关键字with as with temp ( [Id], [parentid]) as ( select Id, ParentId from SysLocation where ParentId = @ParentI…