You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get usage information relating to deprecated features on server sql2008.
44
45
45
46
#>
46
47
[CmdletBinding()]
@@ -51,14 +52,6 @@ function Get-DbaDeprecatedFeature {
51
52
[switch]$EnableException
52
53
)
53
54
54
-
begin {
55
-
$sql="SELECT SERVERPROPERTY('MachineName') AS ComputerName,
56
-
ISNULL(SERVERPROPERTY('InstanceName'), 'MSSQLSERVER') AS InstanceName,
57
-
SERVERPROPERTY('ServerName') AS SqlInstance, object_name, instance_name as DeprecatedFeature, object_name as ObjectName, instance_name as deprecated_feature, cntr_value as UsageCount
58
-
FROM sys.dm_os_performance_counters WHERE object_name like '%Deprecated%'
59
-
and cntr_value > 0 ORDER BY deprecated_feature"
60
-
}
61
-
62
55
process {
63
56
foreach ($instancein$SqlInstance) {
64
57
try {
@@ -67,12 +60,16 @@ function Get-DbaDeprecatedFeature {
$usedDeprecatedFeatures=$server.Query("SELECT LTRIM(RTRIM(instance_name)) AS DeprecatedFeature, cntr_value AS UsageCount FROM sys.dm_os_performance_counters WHERE object_name LIKE '%SQL%Deprecated Features%' AND cntr_value > 0")
0 commit comments