Script-Drop Orphan users from SQL Server Database
This script will help to find orphan users on all databases and will remove them.
2025-05-20
726 reads
This script will help to find orphan users on all databases and will remove them.
2025-05-20
726 reads
2025-05-06
1,222 reads
This script runs a SQL server Health check for services, databases, Always On, replication, CDC job status.
2025-05-05
1,578 reads
To fetch an execution plan from SQL Server's buffer cache (i.e., the in-memory cache of execution plans), you can query the dynamic management views (DMVs) that SQL Server exposes.
2025-04-30
385 reads
Explanation: sys.databases contains information about all databases on the SQL Server instance. • HAS_DBACCESS(name) = 1 filters out the databases you dont have access to. •ORDER BY name sorts the result alphabetically.
2025-03-04
471 reads
This script will help to get the Database mdf & ldf files size, used space, Free space in MB.
2025-02-27 (first published: 2025-02-25)
531 reads
This T-SQL script helps you monitor the size and status of all databases on your SQL Server instance, providing insights into space usage and performance.
2025-01-29 (first published: 2025-01-20)
1,181 reads
This procedure gets current table and index sizes of particular database and stores it to tables.
2025-01-07
398 reads
CDC Changes: The script queries the CDC tables in SQL Server to retrieve the changes (inserts, updates, deletes) since the last sync. Each change is processed with a mapped operation type (INSERT, UPDATE, DELETE).
Real-Time Streaming to BigQuery: The captured changes are streamed directly to BigQuery using its real-time insert_rows_json method, avoiding the need for batch uploads via Google Cloud Storage.
Tracking Last Sync Time: The script tracks the last synchronization time and updates it after every successful sync, ensuring no data is missed.
Low Latency: By continuously querying the CDC tables and streaming the changes, the script achieves near real-time data synchronization.
2024-11-13 (first published: 2024-10-24)
792 reads
In scenarios where you need to consolidate multiple rows into a single, comma-separated value, you can achieve this using FOR XML PATH. This script demonstrates how to retrieve volunteer data and display the days they have selected for participation.
2024-11-11 (first published: 2024-10-23)
1,951 reads
By Steve Jones
A bit of a photo dump, but a few fun memories for me from...
By ReviewMyDB
Part 2 of my What's New in SQL Server for the Developer series. STRING_SPLIT,...
Note: This is more of a note to myself than an attempt to preach...
Telp/Wa 62817825533 Jl. Panglima Sudirman No.35, Baturetno, Kec. Tuban, Kabupaten Tuban, Jawa Timur 62314
Telp/Wa 6288218200233 Jl. Trunojoyo No.15 A, Pejagan, Kec. Bangkalan, Kabupaten Bangkalan, Jawa Timur 69112
Earlier this week I had an issue with a Win 8.1 laptop I was...
I run these queries:
SELECT COUNT(*) FROM dbo.Beer SELECT COUNT(*) FROM etl.beerI get 25 as the result for dbo.beer and 1 for the result for etl.beer. Both tables have identical sructures and both of these are nonpartitioned tables. I run this code:
ALTER TABLE dbo.beer switch TO etl.beer go SELECT COUNT(*) FROM dbo.Beer SELECT COUNT(*) FROM etl.beerWhat happens? See possible answers