Patrick Slesicki


Technical Article

Select Group Members from Logins

Know who all the individual group members are for a given WINDOWS_GROUP login. This script uses the sys.xp_logininfo procedure to find group members for each login on an instance. This is useful when attempting to remove orphaned WINDOWS_LOGINS. May have issues working across your logged in domain.

1 (1)

You rated this post out of 5. Change rating

2020-03-23 (first published: )

1,574 reads

Technical Article

Orphaned Users Search and Destroy

This script will find all orphaned users on all databases on an instance, and generate a script to drop each user. Simply execute, copy the values from the DropScript column to a new SSMS window and execute. There are two risks with this script. Use with caution: This script attempts to take into account users […]

You rated this post out of 5. Change rating

2020-03-16 (first published: )

1,228 reads

Technical Article

String Search

The script searches through every column of every record in a database to find a value. It works with numbers too. Simply assign a value to @MyString. Indicate what datatype(s) you wish to search through, and indicate if you want wildcards, and execute. The search is smart and will only search through columns where @MyString is […]

3 (3)

You rated this post out of 5. Change rating

2020-03-05 (first published: )

1,160 reads

Blogs

AZ-900: Microsoft Azure Fundamentals – The Ultimate Beginner’s Guide to Cloud Mastery

By

In an era where cloud computing drives innovation, understanding its fundamentals is no longer...

Moving to Rancher Desktop

By

I’ve been very happy with Docker Desktop for years, running it on both laptop...

Logging in Azure Data Factory data flows

By

(2025-June-15) Long gone are the days when a data engineer could simply focus on building...

Read the latest Blogs

Forums

What is Between?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item What is Between?

Inside the Walls of Azure SQL MI

By Tonie Huizer

Comments posted to this topic are about the item Inside the Walls of Azure...

SQL Server 2025 Excitement

By Steve Jones - SSC Editor

Comments posted to this topic are about the item SQL Server 2025 Excitement

Visit the forum

Question of the Day

What is Between?

I have a table of products in SQL Server 2022. There are sequential items in the table with ProductIDs of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. If I run this code, how many rows are returned?

SELECT *
FROM dbo.Products
WHERE ProductID
BETWEEN 4 AND 7;

See possible answers