diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs index 837258e5..b6e43992 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs @@ -551,6 +551,16 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentTable, c)); } } + View parentView = context.Parent as View; + if (parentView != null) + { + var retValue = parentView.Triggers; + if (retValue != null) + { + retValue.ClearAndInitialize(filter, extraProperties); + return new SmoCollectionWrapper(retValue).Where(c => PassesFinalFilters(parentView, c)); + } + } return Enumerable.Empty(); } } diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModelDefinition.xml b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModelDefinition.xml index 7112a4bb..35223278 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModelDefinition.xml +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModelDefinition.xml @@ -57,7 +57,10 @@ - + + Table + View + diff --git a/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestData/ObjectExplorer/Baselines/AllSqlObjects.txt b/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestData/ObjectExplorer/Baselines/AllSqlObjects.txt index 37403474..8eba4bdc 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestData/ObjectExplorer/Baselines/AllSqlObjects.txt +++ b/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestData/ObjectExplorer/Baselines/AllSqlObjects.txt @@ -116,6 +116,7 @@ NodeType: Column Label: LastName (Name(nvarchar), not null) SubType: Status: NodeType: Column Label: Suffix (nvarchar(10), null) SubType: Status: NodeType: Column Label: JobTitle (nvarchar(50), not null) SubType: Status: NodeType: Column Label: AdditionalContactInfo (AdditionalContactInfoSchemaCollection, null) SubType: Status: +NodeType: Trigger Label: ViewTrigger SubType: Status: NodeType: Synonym Label: dbo.MyProduct SubType: Status: NodeType: StoredProcedure Label: dbo.uspGetList SubType: Status: NodeType: StoredProcedureParameter Label: @Product (varchar, Input, No default) SubType:Input Status: diff --git a/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestData/ObjectExplorer/TestScripts/AllSqlObjects.sql b/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestData/ObjectExplorer/TestScripts/AllSqlObjects.sql index 239025d4..af4eea41 100644 Binary files a/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestData/ObjectExplorer/TestScripts/AllSqlObjects.sql and b/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestData/ObjectExplorer/TestScripts/AllSqlObjects.sql differ