Fix collation difference in sqlserver input (#3786)
(cherry picked from commit a6d366fb84
)
This commit is contained in:
parent
7f94cb58e4
commit
ea7d884c09
|
@ -1116,30 +1116,30 @@ DECLARE @delayInterval char(8) = CONVERT(Char(8), DATEADD(SECOND, @secondsBetwee
|
||||||
|
|
||||||
DECLARE @w1 TABLE
|
DECLARE @w1 TABLE
|
||||||
(
|
(
|
||||||
WaitType nvarchar(64) NOT NULL,
|
WaitType nvarchar(64) collate SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||||
WaitTimeInMs bigint NOT NULL,
|
WaitTimeInMs bigint NOT NULL,
|
||||||
WaitTaskCount bigint NOT NULL,
|
WaitTaskCount bigint NOT NULL,
|
||||||
CollectionDate datetime NOT NULL
|
CollectionDate datetime NOT NULL
|
||||||
)
|
)
|
||||||
DECLARE @w2 TABLE
|
DECLARE @w2 TABLE
|
||||||
(
|
(
|
||||||
WaitType nvarchar(64) NOT NULL,
|
WaitType nvarchar(64) collate SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||||
WaitTimeInMs bigint NOT NULL,
|
WaitTimeInMs bigint NOT NULL,
|
||||||
WaitTaskCount bigint NOT NULL,
|
WaitTaskCount bigint NOT NULL,
|
||||||
CollectionDate datetime NOT NULL
|
CollectionDate datetime NOT NULL
|
||||||
)
|
)
|
||||||
DECLARE @w3 TABLE
|
DECLARE @w3 TABLE
|
||||||
(
|
(
|
||||||
WaitType nvarchar(64) NOT NULL
|
WaitType nvarchar(64) collate SQL_Latin1_General_CP1_CI_AS NOT NULL
|
||||||
)
|
)
|
||||||
DECLARE @w4 TABLE
|
DECLARE @w4 TABLE
|
||||||
(
|
(
|
||||||
WaitType nvarchar(64) NOT NULL,
|
WaitType nvarchar(64) collate SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||||
WaitCategory nvarchar(64) NOT NULL
|
WaitCategory nvarchar(64) collate SQL_Latin1_General_CP1_CI_AS NOT NULL
|
||||||
)
|
)
|
||||||
DECLARE @w5 TABLE
|
DECLARE @w5 TABLE
|
||||||
(
|
(
|
||||||
WaitCategory nvarchar(64) NOT NULL,
|
WaitCategory nvarchar(64) collate SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||||
WaitTimeInMs bigint NOT NULL,
|
WaitTimeInMs bigint NOT NULL,
|
||||||
WaitTaskCount bigint NOT NULL
|
WaitTaskCount bigint NOT NULL
|
||||||
)
|
)
|
||||||
|
@ -1380,12 +1380,12 @@ INSERT @w4 (WaitType, WaitCategory) VALUES ('ABR', 'OTHER') ,
|
||||||
|
|
||||||
INSERT @w1 (WaitType, WaitTimeInMs, WaitTaskCount, CollectionDate)
|
INSERT @w1 (WaitType, WaitTimeInMs, WaitTaskCount, CollectionDate)
|
||||||
SELECT
|
SELECT
|
||||||
WaitType = wait_type
|
WaitType = wait_type collate SQL_Latin1_General_CP1_CI_AS
|
||||||
, WaitTimeInMs = SUM(wait_time_ms)
|
, WaitTimeInMs = SUM(wait_time_ms)
|
||||||
, WaitTaskCount = SUM(waiting_tasks_count)
|
, WaitTaskCount = SUM(waiting_tasks_count)
|
||||||
, CollectionDate = GETDATE()
|
, CollectionDate = GETDATE()
|
||||||
FROM sys.dm_os_wait_stats
|
FROM sys.dm_os_wait_stats
|
||||||
WHERE [wait_type] NOT IN
|
WHERE [wait_type] collate SQL_Latin1_General_CP1_CI_AS NOT IN
|
||||||
(
|
(
|
||||||
SELECT WaitType FROM @w3
|
SELECT WaitType FROM @w3
|
||||||
)
|
)
|
||||||
|
@ -1396,12 +1396,12 @@ WAITFOR DELAY @delayInterval;
|
||||||
|
|
||||||
INSERT @w2 (WaitType, WaitTimeInMs, WaitTaskCount, CollectionDate)
|
INSERT @w2 (WaitType, WaitTimeInMs, WaitTaskCount, CollectionDate)
|
||||||
SELECT
|
SELECT
|
||||||
WaitType = wait_type
|
WaitType = wait_type collate SQL_Latin1_General_CP1_CI_AS
|
||||||
, WaitTimeInMs = SUM(wait_time_ms)
|
, WaitTimeInMs = SUM(wait_time_ms)
|
||||||
, WaitTaskCount = SUM(waiting_tasks_count)
|
, WaitTaskCount = SUM(waiting_tasks_count)
|
||||||
, CollectionDate = GETDATE()
|
, CollectionDate = GETDATE()
|
||||||
FROM sys.dm_os_wait_stats
|
FROM sys.dm_os_wait_stats
|
||||||
WHERE [wait_type] NOT IN
|
WHERE [wait_type] collate SQL_Latin1_General_CP1_CI_AS NOT IN
|
||||||
(
|
(
|
||||||
SELECT WaitType FROM @w3
|
SELECT WaitType FROM @w3
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue