SELECT COUNT(wait_type) FROM sys.dm_os_wait_stats ; SELECT COUNT(DISTINCT wait_type) FROM sys.dm_os_wait_stats ;
SELECT wait_type INTO #t FROM sys.dm_os_wait_stats GROUP BY wait_type
ALTER TABLE [#t] ALTER COLUMN [wait_type] NVARCHAR(50) COLLATE Chinese_PRC_90_CI_AI
SELECT COUNT(wait_type) FROM #t ; SELECT COUNT(DISTINCT wait_type) FROM #t ;
SELECT DISTINCT wait_type FROM sys.dm_os_wait_stats WHERE [wait_type] = 'MISCELLANEOUS'
SELECT DISTINCT wait_type COLLATE Chinese_PRC_90_CI_AI FROM sys.dm_os_wait_stats WHERE [wait_type] = 'MISCELLANEOUS' COLLATE Chinese_PRC_90_CI_AI ORDER BY wait_type COLLATE Chinese_PRC_90_CI_AI
[解决办法] SELECT wait_type INTO #tb FROM sys.dm_os_wait_stats WHERE [wait_type] = 'MISCELLANEOUS' --2 SELECT name ,[collation] FROM [tempdb].sys.[syscolumns] AS s WHERE id=OBJECT_ID('tempdb..#tb')
SELECT DISTINCT wait_type FROM #tb ORDER BY wait_type COLLATE Chinese_PRC_CI_AS --1 [解决办法]