字体:大 中 小
护眼
关灯
上一章
目录
下一章
第242章被困百草堂 (7 / 9)
select o.object_id, o.name, SCHEMA_NAME(o.schema_id), t.object_db, (case o.type when 'P' then @sp when 'TR' then @tr else @udf end), t.object_id, t.object_name, t.object_schema, t.object_db, t.object_type, 1, @iter_no + 1
from #t1 as t
join sys.plan_guides as pg on pg.plan_guide_id = t.object_id
join sys.objects as o on o.object_id = pg.scope_object_id
where @iter_no = t.rank and t.object_type = @pg and (t.object_svr IS null and t.object_db = db_name())
set @rows = @rows + @@rowcount
-- objects referenced by synonym
insert #t1 (object_id, object_name, object_schema, object_db, object_type, relative_id, relative_name, relative_schema, relative_db, relative_type, schema_bound, rank)
select o.object_id, o.name, SCHEMA_NAME(o.schema_id), t.object_db, (case when o.type = 'U' then @u when o.type = 'V' then @v when o.type in ('P', 'RF', 'PC') then @sp when o.type = 'AF' then @uda else @udf end), t.obj? p(o
-+******* 0 ) G {3 ~5