Skip to content

Instantly share code, notes, and snippets.

@VladDBA
Last active February 15, 2024 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VladDBA/a09b4f58686e03642a8565a2614780a1 to your computer and use it in GitHub Desktop.
Save VladDBA/a09b4f58686e03642a8565a2614780a1 to your computer and use it in GitHub Desktop.
v_LongUsers
USE StackOverflow
GO
CREATE VIEW v_LongUsers
WITH SCHEMABINDING
AS
SELECT [Id],
[AboutMe],
[Age],
[CreationDate],
[DisplayName],
[DownVotes],
[EmailHash],
[LastAccessDate],
[Location],
[Reputation],
[UpVotes],
[Views],
[WebsiteUrl],
[AccountId],
[CheckSum]
FROM [dbo].[Users]
WHERE LEN([DisplayName]) > 35;
GO
CREATE UNIQUE CLUSTERED INDEX CIX_VLongUsers
ON v_LongUsers([Id])
WITH(ONLINE=OFF, MAXDOP=0);
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment