Skip to content

Instantly share code, notes, and snippets.

View LuckyDima's full-sized avatar
🏠
Working from home

Dmitriy Ivanov LuckyDima

🏠
Working from home
View GitHub Profile
@LuckyDima
LuckyDima / Weight of words in sentences
Last active May 16, 2019 10:57
Finding the weight of words for different rows
DECLARE @tbl TABLE (FullName NVARCHAR(MAX))
INSERT @tbl(FullName)
VALUES
(N'All-America Research Team: Basic Materials - Best UAC (Chemicals)'),
('All-America Research Team: Basic Materials - Chemicals'),
('All-America Fixed-Income Research Team: Client Services - Best Credit-Rating Agencies'),
('All-America Fixed-Income Research Team'),
('All-America Research Team'),
('All-America Trading Team'),
IF EXISTS (SELECT TOP (1) 1 FROM sys.sysobjects (NOLOCK) WHERE name = 'GetHash' AND xtype IN ('FN'))
DROP FUNCTION GetHash
GO
CREATE FUNCTION GetHash(@Value NVARCHAR(MAX) = NULL)
RETURNS BIGINT
AS
BEGIN