Skip to content

Commit

Permalink
Push new SQL Queries 📚
Browse files Browse the repository at this point in the history
  • Loading branch information
x-limitless-x authored Nov 4, 2022
1 parent 246e1bc commit 31158f1
Show file tree
Hide file tree
Showing 70 changed files with 765 additions and 699 deletions.
2 changes: 1 addition & 1 deletion SQL Queries/Data Warehouse/DW_AggregationHistory.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ SELECT ds.DatasetDefaultName,
FROM StandardDatasetAggregationHistory sdah WITH(NOLOCK)
JOIN Dataset ds WITH (NOLOCK) ON sdah.DatasetId = ds.DatasetId
JOIN AggregationType atype WITH (NOLOCK) ON sdah.AggregationTypeId = atype.AggregationTypeId
ORDER BY StandardDatasetAggregationHistoryRowId DESC
ORDER BY sdah.FirstAggregationDurationSeconds DESC
6 changes: 6 additions & 0 deletions SQL Queries/Data Warehouse/DW_Alerts_ByCount.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SELECT TOP 50 SUM(1) AS AlertCount, AlertName, AlertDescription, AlertProblemGuid, MonitorSystemName
FROM Alert.vAlert va INNER JOIN
Monitor mon on mon.MonitorGuid = va.AlertProblemGuid
WHERE RaisedDateTime is not NULL
GROUP BY AlertName, AlertDescription, AlertProblemGuid, MonitorSystemName
ORDER BY AlertCount DESC
5 changes: 5 additions & 0 deletions SQL Queries/Data Warehouse/DW_Alerts_ByDay.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT CONVERT(VARCHAR(20), DBCreatedDateTime, 102) AS DayAdded, COUNT(*) AS NumAlertsPerDay
FROM Alert.vAlert
WHERE RaisedDateTime is not NULL
GROUP BY CONVERT(VARCHAR(20), DBCreatedDateTime, 102)
ORDER BY DayAdded DESC
15 changes: 15 additions & 0 deletions SQL Queries/Data Warehouse/DW_Alerts_ByOldest.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
SELECT TOP 50 DATEDIFF(Day,RaisedDateTime,current_timestamp) AS DaysOpened, Case Severity
When 0 then 'Information'
When 1 then 'Warning'
When 2 then 'Critical'
End as [Severity],RepeatCount, AlertName, AlertDescription, MonitorSystemName, MonitorGuid, ParameterValue, Case ResolutionState
When 0 then 'Open'
End as [ResolutionState]
FROM Alert.vAlert va INNER JOIN
Monitor mon on mon.MonitorGuid = va.AlertProblemGuid INNER JOIN
Alert.vAlertParameter vap on va.AlertGuid = vap.AlertGuid INNER JOIN
Alert.vAlertResolutionState vars on va.AlertGuid = vars.AlertGuid
WHERE RaisedDateTime is not NULL
AND ResolutionState = 0
GROUP BY AlertName, RepeatCount, RaisedDateTime, Severity, MonitorSystemName, DWLastModifiedDateTime, AlertDescription, ParameterValue, MonitorGuid, ResolutionState
ORDER BY DaysOpened DESC, RepeatCount DESC
6 changes: 6 additions & 0 deletions SQL Queries/Data Warehouse/DW_Alerts_ByRepeat.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SELECT TOP 50 RepeatCount, AlertName, AlertDescription, AlertProblemGuid, MonitorSystemName
FROM Alert.vAlert va INNER JOIN
Monitor mon on mon.MonitorGuid = va.AlertProblemGuid
WHERE RaisedDateTime is not NULL
GROUP BY AlertName, RepeatCount, AlertDescription, AlertProblemGuid, MonitorSystemName
ORDER BY RepeatCount DESC
2 changes: 1 addition & 1 deletion SQL Queries/Data Warehouse/DW_Greyed_Out_Reason_Codes.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ AS OutageDays, HSO.ReasonCode, DS.Name AS ReasonString FROM vManagedEntity AS ME
INNER JOIN vHealthServiceOutage AS HSO ON HSO.ManagedEntityRowId = ME.ManagedEntityRowId
INNER JOIN vStringResource AS SR ON HSO.ReasonCode = REPLACE(LEFT(SR.StringResourceSystemName, LEN(SR.StringResourceSystemName) - CHARINDEX('.', REVERSE(SR.StringResourceSystemName))), 'System.Availability.StateData.Reasons.', '')
INNER JOIN vDisplayString AS DS ON DS.ElementGuid = SR.StringResourceGuid WHERE (HSO.EndDateTime IS NULL) AND (SR.StringResourceSystemName LIKE 'System.Availability.StateData.Reasons.[0-9]%') AND DS.LanguageCode = 'ENU'
ORDER BY OutageStartDateTime
ORDER BY OutageStartDateTime DESC
18 changes: 9 additions & 9 deletions SQL Queries/Data Warehouse/DW_Perf_byCounter.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*Top 30 performance insertions: */
select TOP 30 PR.CounterName,PR.ObjectName, vR.ruledefaultname As RuleName, COUNT(PR.countername) AS Total
from Perf.vPerfRaw perf
join ManagedEntity ME WITH(NOLOCK) on perf.ManagedEntityRowId = ME.ManagedEntityRowId
join PerformanceRuleInstance PRI WITH(NOLOCK) on perf.PerformanceRuleInstanceRowId = PRI.PerformanceRuleInstanceRowId
join PerformanceRule PR WITH(NOLOCK) on PRI.RuleRowId = PR.RuleRowId
join vRule vR on vR.rulerowid = PR.RuleRowId
where perf.DateTime > GetUTCDate() -48
GROUP BY PR.ObjectName, PR.CounterName, vr.ruledefaultname
/*Top 30 performance insertions: */
select TOP 30 PR.CounterName,PR.ObjectName, vR.ruledefaultname As RuleName, COUNT(PR.countername) AS Total
from Perf.vPerfRaw perf
join ManagedEntity ME WITH(NOLOCK) on perf.ManagedEntityRowId = ME.ManagedEntityRowId
join PerformanceRuleInstance PRI WITH(NOLOCK) on perf.PerformanceRuleInstanceRowId = PRI.PerformanceRuleInstanceRowId
join PerformanceRule PR WITH(NOLOCK) on PRI.RuleRowId = PR.RuleRowId
join vRule vR on vR.rulerowid = PR.RuleRowId
where perf.DateTime > GetUTCDate() -48
GROUP BY PR.ObjectName, PR.CounterName, vr.ruledefaultname
ORDER BY COUNT (PR.CounterName) dESC
18 changes: 9 additions & 9 deletions SQL Queries/Data Warehouse/DW_Perf_byManagedEntity.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
select r.RuleDefaultName, pr.ObjectName, pr.CounterName, mp.ManagementPackDefaultName as MPName, COUNT(me.ManagedEntityDefaultName) AS Total
from Perf.vPerfRaw perf
join vPerformanceRuleInstance PRI on perf.PerformanceRuleInstanceRowId = PRI.PerformanceRuleInstanceRowId
join vPerformanceRule pr on PRI.RuleRowId = PR.RuleRowId
join vManagedEntity me on perf.ManagedEntityRowId = ME.ManagedEntityRowId
join [dbo].[vRule] r on r.RuleRowId = PR.RuleRowId
join vManagementPack mp on r.ManagementPackRowId = mp.ManagementPackRowId
where perf.DateTime > GetUTCDate() -48
GROUP BY PR.ObjectName, PR.CounterName, r.ruledefaultname, mp.ManagementPackDefaultName
select r.RuleDefaultName, pr.ObjectName, pr.CounterName, mp.ManagementPackDefaultName as MPName, COUNT(me.ManagedEntityDefaultName) AS Total
from Perf.vPerfRaw perf
join vPerformanceRuleInstance PRI on perf.PerformanceRuleInstanceRowId = PRI.PerformanceRuleInstanceRowId
join vPerformanceRule pr on PRI.RuleRowId = PR.RuleRowId
join vManagedEntity me on perf.ManagedEntityRowId = ME.ManagedEntityRowId
join [dbo].[vRule] r on r.RuleRowId = PR.RuleRowId
join vManagementPack mp on r.ManagementPackRowId = mp.ManagementPackRowId
where perf.DateTime > GetUTCDate() -48
GROUP BY PR.ObjectName, PR.CounterName, r.ruledefaultname, mp.ManagementPackDefaultName
ORDER BY COUNT (me.ManagedEntityDefaultName) DESC
9 changes: 0 additions & 9 deletions SQL Queries/Data Warehouse/Index_Maint_DW.sql

This file was deleted.

2 changes: 1 addition & 1 deletion SQL Queries/Data Warehouse/MG_SQLPatchVersion_DW.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-- Get the Data Warehouse Update Rollup Version.
-- Get the Data Warehouse Update Rollup Version.
select * from [dbo].[SqlPatchVersion] WITH (NOLOCK)
8 changes: 4 additions & 4 deletions SQL Queries/Data Warehouse/SQL_DBOwner_DW.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
select DB_NAME(DB_ID()), suser_sname(owner_sid) AS 'Owner'
from sys.databases sdb
WHERE database_id = DB_ID()
go
-- Get current context DB Owner
select DB_NAME(DB_ID()), suser_sname(owner_sid) AS 'Owner'
from sys.databases sdb
WHERE database_id = DB_ID()
2 changes: 1 addition & 1 deletion SQL Queries/Data Warehouse/SQL_DBSize_DW.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ sf.FILENAME AS 'Location',
sf.FILEID AS 'FileId'
FROM dbo.sysfiles sf WITH (NOLOCK)
JOIN sys.master_files smf WITH (NOLOCK) ON smf.physical_name = sf.filename
ORDER BY FileId
ORDER BY FileId
30 changes: 30 additions & 0 deletions SQL Queries/Data Warehouse/SQL_DBSize_DW_TempDB.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-- Modified 2/9/2022 - Included Free Space %, added MB to value fields.
-- Modified 6/21/2022 - Attempted to fix Arithmetic Overflow error when run in large environments. Added 'SpaceUsed(%)' and 'AutoGrowthStatus' columns.
-- Blake Drumm (blakedrumm@microsoft.com)
USE tempdb

SELECT sf.NAME AS 'Name',
CONCAT(convert(decimal(12,2), round(sf.size/128.000, 2)), ' MB') AS 'FileSize(MB)',
CONCAT(convert(int, round(100 * convert(bigint,(sf.size-fileproperty(sf.name, 'SpaceUsed'))) / convert(bigint,sf.size), 2)),' %') AS 'FreeSpace(%)',
CONCAT(convert(decimal(12,2), round((sf.size-fileproperty(sf.name, 'SpaceUsed'))/128.000, 2)), ' MB') AS 'FreeSpace(MB)',
CONCAT(convert(int, 100 - (round(100 * convert(bigint,(sf.size-fileproperty(sf.name, 'SpaceUsed'))) / convert(bigint,sf.size), 2))),' %') AS 'SpaceUsed(%)',
CONCAT(convert(decimal(12,2), round(fileproperty(sf.name, 'SpaceUsed')/128.000, 2)), ' MB') AS 'SpaceUsed(MB)',
CASE smf.growth
WHEN 0 THEN 'Disabled'
ELSE 'Enabled'
END AS 'AutoGrowthStatus',
CASE smf.is_percent_growth
WHEN 1 THEN CONCAT(CONVERT(bigint, smf.growth), ' %')
ELSE CONCAT(convert(decimal(12,2), smf.growth/128),' MB')
END AS 'AutoGrowth',
CASE (sf.maxsize)
WHEN -1 THEN 'Unlimited'
WHEN 268435456 THEN 'Max Size (2TB)'
ELSE CONCAT(convert(decimal(12,2), round(sf.maxsize/128.000, 2)), ' MB')
END AS 'AutoGrowthMB(MAX)',
sf.status,
sf.FILENAME AS 'Location',
sf.FILEID AS 'FileId'
FROM dbo.sysfiles sf WITH (NOLOCK)
JOIN sys.master_files smf WITH (NOLOCK) ON smf.physical_name = sf.filename
ORDER BY FileId
2 changes: 1 addition & 1 deletion SQL Queries/Data Warehouse/SQL_ErrorLogLocation_DW.sql
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xp_readerrorlog 0, 1, N'Logging SQL Server messages in file'
xp_readerrorlog 0, 1, N'Logging SQL Server messages in file'
36 changes: 18 additions & 18 deletions SQL Queries/Data Warehouse/SQL_Primary_Replicas_DW.sql
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
IF SERVERPROPERTY ('IsHadrEnabled') = 1
BEGIN
SELECT
AGC.name -- Availability Group
, RCS.replica_server_name -- SQL cluster node name
, ARS.role_desc -- Replica Role
, AGL.dns_name -- Listener Name
FROM
sys.availability_groups_cluster AS AGC
INNER JOIN sys.dm_hadr_availability_replica_cluster_states AS RCS
ON
RCS.group_id = AGC.group_id
INNER JOIN sys.dm_hadr_availability_replica_states AS ARS
ON
ARS.replica_id = RCS.replica_id
INNER JOIN sys.availability_group_listeners AS AGL
ON
AGL.group_id = ARS.group_id
IF SERVERPROPERTY ('IsHadrEnabled') = 1
BEGIN
SELECT
AGC.name -- Availability Group
, RCS.replica_server_name -- SQL cluster node name
, ARS.role_desc -- Replica Role
, AGL.dns_name -- Listener Name
FROM
sys.availability_groups_cluster AS AGC
INNER JOIN sys.dm_hadr_availability_replica_cluster_states AS RCS
ON
RCS.group_id = AGC.group_id
INNER JOIN sys.dm_hadr_availability_replica_states AS ARS
ON
ARS.replica_id = RCS.replica_id
INNER JOIN sys.availability_group_listeners AS AGL
ON
AGL.group_id = ARS.group_id
END
4 changes: 2 additions & 2 deletions SQL Queries/Data Warehouse/SQL_Properties_DW.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SELECT CASE
SELECT CASE
(SELECT is_broker_enabled
FROM sys.databases
WHERE name=db_name())
Expand Down Expand Up @@ -49,4 +49,4 @@ SELECT CASE
END AS [IsFullTextInstalled],
CONVERT(nvarchar(50), serverproperty('Collation')) AS COLLATION,
CONVERT(nvarchar(50), serverproperty('ComputerNamePhysicalNetBIOS')) AS ComputerNamePhysicalNetBIOS,
CONVERT(nvarchar(50), serverproperty('ComputerNamePhysicalNetBIOS')) AS 'SqlHost'
CONVERT(nvarchar(50), serverproperty('ComputerNamePhysicalNetBIOS')) AS 'SqlHost'
64 changes: 32 additions & 32 deletions SQL Queries/Data Warehouse/SQL_UserMapping_DW.sql
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
DECLARE @DB_Users TABLE
(DBName sysname, UserName sysname, LoginType sysname, AssociatedRole varchar(max),create_date datetime,modify_date datetime)

INSERT @DB_Users
EXEC sp_MSforeachdb

'
use [?]
SELECT ''?'' AS DB_Name,
case prin.name when ''dbo'' then prin.name + '' (''+ (select SUSER_SNAME(owner_sid) from master.sys.databases where name =''?'') + '')'' else prin.name end AS UserName,
prin.type_desc AS LoginType,
isnull(USER_NAME(mem.role_principal_id),'''') AS AssociatedRole ,create_date,modify_date
FROM sys.database_principals prin
LEFT OUTER JOIN sys.database_role_members mem ON prin.principal_id=mem.member_principal_id
WHERE prin.sid IS NOT NULL and prin.sid NOT IN (0x00) and
prin.is_fixed_role <> 1 AND prin.name NOT LIKE ''##%'''

SELECT
dbname,username ,logintype ,create_date ,modify_date ,
STUFF(
(
SELECT ',' + CONVERT(VARCHAR(500),associatedrole)
FROM @DB_Users user2
WHERE
user1.DBName=user2.DBName AND user1.UserName=user2.UserName
FOR XML PATH('')
)
,1,1,'') AS Permissions_user
FROM @DB_Users user1
GROUP BY
dbname,username ,logintype ,create_date ,modify_date
ORDER BY DBName, username
DECLARE @DB_Users TABLE
(DBName sysname, UserName sysname, LoginType sysname, AssociatedRole varchar(max),create_date datetime,modify_date datetime)

INSERT @DB_Users
EXEC sp_MSforeachdb

'
use [?]
SELECT ''?'' AS DB_Name,
case prin.name when ''dbo'' then prin.name + '' (''+ (select SUSER_SNAME(owner_sid) from master.sys.databases where name =''?'') + '')'' else prin.name end AS UserName,
prin.type_desc AS LoginType,
isnull(USER_NAME(mem.role_principal_id),'''') AS AssociatedRole ,create_date,modify_date
FROM sys.database_principals prin
LEFT OUTER JOIN sys.database_role_members mem ON prin.principal_id=mem.member_principal_id
WHERE prin.sid IS NOT NULL and prin.sid NOT IN (0x00) and
prin.is_fixed_role <> 1 AND prin.name NOT LIKE ''##%'''

SELECT
dbname,username ,logintype ,create_date ,modify_date ,
STUFF(
(
SELECT ',' + CONVERT(VARCHAR(500),associatedrole)
FROM @DB_Users user2
WHERE
user1.DBName=user2.DBName AND user1.UserName=user2.UserName
FOR XML PATH('')
)
,1,1,'') AS Permissions_user
FROM @DB_Users user1
GROUP BY
dbname,username ,logintype ,create_date ,modify_date
ORDER BY DBName, username
2 changes: 1 addition & 1 deletion SQL Queries/OperationsManager/Alerts_ByCount.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SELECT TOP 20 SUM(1) AS AlertCount, AlertStringName, AlertStringDescription, MonitoringRuleId, Name
SELECT TOP 50 SUM(1) AS AlertCount, AlertStringName, AlertStringDescription, MonitoringRuleId, Name
FROM Alertview WITH (NOLOCK)
WHERE TimeRaised is not NULL
GROUP BY AlertStringName, AlertStringDescription, MonitoringRuleId, Name
Expand Down
4 changes: 2 additions & 2 deletions SQL Queries/OperationsManager/Alerts_ByDay.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SELECT CONVERT(VARCHAR(20), TimeAdded, 102) AS DayAdded, COUNT(*) AS NumAlertsPerDay
SELECT TOP 7 CONVERT(VARCHAR(20), TimeAdded, 102) AS DayAdded, COUNT(*) AS NumAlertsPerDay
FROM AlertView
WHERE TimeRaised is not NULL
GROUP BY CONVERT(VARCHAR(20), TimeAdded, 102)
ORDER BY DayAdded DESC
ORDER BY DayAdded DESC
24 changes: 12 additions & 12 deletions SQL Queries/OperationsManager/Alerts_ByOldest.sql
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
SELECT TOP 20 DATEDIFF(Day,TimeRaised,current_timestamp) AS DaysOpened, Case Severity
When 0 then 'Information'
When 1 then 'Warning'
When 2 then 'Critical'
End as [Severity],RepeatCount, AlertStringName, AlertStringDescription, MonitoringObjectDisplayName, MonitoringRuleId, Name, AlertParams, Case ResolutionState
When 0 then 'Open'
End as [ResolutionState]
FROM Alertview WITH (NOLOCK)
WHERE Timeraised is not NULL
AND ResolutionState = 0
GROUP BY AlertStringName, RepeatCount, TimeRaised, Severity, MonitoringObjectDisplayName, Lastmodified,AlertStringDescription, AlertParams, MonitoringRuleId, Name, ResolutionState
ORDER BY DaysOpened DESC, RepeatCount DESC
SELECT TOP 50 DATEDIFF(Day,TimeRaised,current_timestamp) AS DaysOpened, Case Severity
When 0 then 'Information'
When 1 then 'Warning'
When 2 then 'Critical'
End as [Severity],RepeatCount, AlertStringName, AlertStringDescription, MonitoringObjectDisplayName, MonitoringRuleId, Name, AlertParams, Case ResolutionState
When 0 then 'Open'
End as [ResolutionState]
FROM Alertview WITH (NOLOCK)
WHERE Timeraised is not NULL
AND ResolutionState = 0
GROUP BY AlertStringName, RepeatCount, TimeRaised, Severity, MonitoringObjectDisplayName, Lastmodified,AlertStringDescription, AlertParams, MonitoringRuleId, Name, ResolutionState
ORDER BY DaysOpened DESC, RepeatCount DESC
4 changes: 2 additions & 2 deletions SQL Queries/OperationsManager/Alerts_ByRepeat.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SELECT TOP 20 RepeatCount, AlertStringName, AlertStringDescription, MonitoringRuleId, Name
SELECT TOP 50 RepeatCount, AlertStringName, AlertStringDescription, MonitoringRuleId, Name
FROM Alertview WITH (NOLOCK)
WHERE Timeraised is not NULL
GROUP BY AlertStringName, RepeatCount, AlertStringDescription, MonitoringRuleId, Name
ORDER BY RepeatCount DESC
ORDER BY RepeatCount DESC
28 changes: 14 additions & 14 deletions SQL Queries/OperationsManager/Broken_Relationships.sql
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---Check for Broken Relationship
SELECT R.[RelationshipId],
RT.[RelationshipTypeId],
S.[FullName] as SourceName,
T.[FullName] as TargetName
FROM dbo.[Relationship] R with (nolock)
INNER JOIN dbo.[RelationshipType] RT with (nolock)
ON RT.[RelationshipTypeId] = R.[RelationshipTypeId]
INNER JOIN dbo.[BaseManagedEntity] S with (nolock)
ON S.[BaseManagedEntityId] = R.[SourceEntityId]
INNER JOIN dbo.[BaseManagedEntity] T with (nolock)
ON T.[BaseManagedEntityId] = R.[TargetEntityId]
WHERE R.[IsDeleted] = 0
AND (S.[IsDeleted] = 1 OR T.[IsDeleted] = 1)
---Check for Broken Relationship
SELECT R.[RelationshipId],
RT.[RelationshipTypeId],
S.[FullName] as SourceName,
T.[FullName] as TargetName
FROM dbo.[Relationship] R with (nolock)
INNER JOIN dbo.[RelationshipType] RT with (nolock)
ON RT.[RelationshipTypeId] = R.[RelationshipTypeId]
INNER JOIN dbo.[BaseManagedEntity] S with (nolock)
ON S.[BaseManagedEntityId] = R.[SourceEntityId]
INNER JOIN dbo.[BaseManagedEntity] T with (nolock)
ON T.[BaseManagedEntityId] = R.[TargetEntityId]
WHERE R.[IsDeleted] = 0
AND (S.[IsDeleted] = 1 OR T.[IsDeleted] = 1)
2 changes: 1 addition & 1 deletion SQL Queries/OperationsManager/ConfigChurn_OpsDB.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ HAVING
COUNT(*)
) > 10
order by
[Number of changes] DESC, LanguageCode DESC
[Number of changes] DESC, LanguageCode DESC
20 changes: 10 additions & 10 deletions SQL Queries/OperationsManager/Configuration_OpsDB.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
SELECT
ManagedTypePropertyName,
SettingValue,
mtv.DisplayName,
gs.LastModified
FROM
GlobalSettings gs WITH (NOLOCK)
INNER JOIN ManagedTypeProperty mtp WITH (NOLOCK) on gs.ManagedTypePropertyId = mtp.ManagedTypePropertyId
INNER JOIN ManagedTypeView mtv on mtp.ManagedTypeId = mtv.Id
ORDER BY
SELECT
ManagedTypePropertyName,
SettingValue,
mtv.DisplayName,
gs.LastModified
FROM
GlobalSettings gs WITH (NOLOCK)
INNER JOIN ManagedTypeProperty mtp WITH (NOLOCK) on gs.ManagedTypePropertyId = mtp.ManagedTypePropertyId
INNER JOIN ManagedTypeView mtv on mtp.ManagedTypeId = mtv.Id
ORDER BY
mtv.DisplayName
Loading

0 comments on commit 31158f1

Please sign in to comment.