我只是想将'view'div高度限制为窗口高度,并在超出窗口高度的文本旁边显示一个滚动条。.我可以正常工作,但由于某种原因,我又弄乱了,看不到为什么。
------------------------------------------------------------------
--because of the possibility of an object in this database reference a broken link... we have to batch through each object we wish to lookup it's references...
------------------------------------------------------------------
SET NOCOUNT ON;
if OBJECT_ID('tempdb..#ReferencingLookup') is not null
drop table #ReferencingLookup;
CREATE TABLE tempdb..#ReferencingLookup(
[REFERENCING_DB] [nvarchar](1000) NULL,
[REFERENCING_SCHEMA] [nvarchar](1000) NULL,
[REFERENCING_OBJECT] [nvarchar](1000) NULL,
[REFERENCING_TYPE_DESC] [nvarchar](1000) NULL,
[REFERENCED_DB] [nvarchar](1000) NULL,
[REFERENCED_SCHEMA] [nvarchar](1000) NULL,
[REFERENCED_OBJECT] [nvarchar](1000) NULL,
[REFERENCED_MINOR_OBJECT] [nvarchar](1000) NULL,
[REFERENCED_TYPE_DESC] [nvarchar](1000) NULL,
[REFERENCED_CLASS_DESC] [nvarchar](1000) NULL,
[REFERENCED_IS_CALLER_DEPENDENT] [bit] NOT NULL
) ON [PRIMARY]
DECLARE @REFERENCING_SCHEMA varchar(1000), @REFERENCING_OBJECT varchar(1000), @REFERENCING_TYPE_DESC nvarchar(1000);
DECLARE referencing_cursor CURSOR FOR
select distinct REFERENCING_SCHEMA,REFERENCING_OBJECT,REFERENCING_TYPE_DESC
from
(
select
t.SCHEMA_NAME as REFERENCING_SCHEMA
,t.OBJECT_NAME as REFERENCING_OBJECT
,t.type_desc as REFERENCING_TYPE_DESC
FROM
(
select o.name as OBJECT_NAME,o.TYPE_DESC,s.name as SCHEMA_NAME
from sys.objects o
left join sys.schemas s on o.schema_id = s.schema_id
) t
) a
OPEN referencing_cursor
FETCH NEXT FROM referencing_cursor
INTO @REFERENCING_SCHEMA, @REFERENCING_OBJECT, @REFERENCING_TYPE_DESC
declare @ref_type as varchar(1000) = 'OBJECT'
WHILE @@FETCH_STATUS = 0
BEGIN
declare @concat_refs as varchar(1000) = '[' + @REFERENCING_SCHEMA + '].[' + @REFERENCING_OBJECT + ']'
begin try
print @concat_refs
insert into #ReferencingLookup
select
DB_NAME() as REFERENCING_DB
,t.SCHEMA_NAME as REFERENCING_SCHEMA
,t.OBJECT_NAME as REFERENCING_OBJECT
,t.type_desc as REFERENCING_TYPE_DESC
--,'' as SEPERATOR1
,case when isnull(ref.referenced_database_name,DB_NAME()) = '' then '?' else isnull(ref.referenced_database_name,DB_NAME()) end as [REFERENCED_DB]
,ref.referenced_schema_name as REFERENCED_SCHEMA
,ref.referenced_entity_name as REFERENCED_OBJECT
,ref.referenced_minor_name as REFERENCED_MINOR_OBJECT
,obj.type_desc as REFERENCED_TYPE_DESC
,ref.referenced_class_desc as REFERENCED_CLASS_DESC
,ref.is_caller_dependent as REFERENCED_IS_CALLER_DEPENDENT
FROM
(
select o.name as OBJECT_NAME,o.TYPE_DESC,s.name as SCHEMA_NAME
from sys.objects o
left join sys.schemas s on o.schema_id = s.schema_id
where s.name = @REFERENCING_SCHEMA and o.name = @REFERENCING_OBJECT
) t
cross apply sys.dm_sql_referenced_entities(@concat_refs, @ref_type) ref
left join sys.objects obj on ref.referenced_id = obj.object_id
end try
begin catch
select ERROR_MESSAGE();
end catch
FETCH NEXT FROM referencing_cursor
INTO @REFERENCING_SCHEMA, @REFERENCING_OBJECT, @REFERENCING_TYPE_DESC
END
CLOSE referencing_cursor;
DEALLOCATE referencing_cursor;
------------------------------------------------------------------
------------------------------------------------------------------
--peak a boo at the results...
select *
,'[' + REFERENCED_DB +'].[' + REFERENCED_SCHEMA + '].[' + REFERENCED_OBJECT + ']' as REFERENCED_OBJECT_FULLY_SPECIFIED
from #ReferencingLookup
所以我想看三列,所有窗口的最大高度,第一列有3行,其中前两行限制其内容,下一行占据屏幕的剩余高度,并在其中滚动条(表示在计划列表div中)。由于可能很简单,因此目前有点愚蠢;)