2025-12-29 (first published: 2025-12-25)
808 reads
2025-12-29 (first published: 2025-12-25)
808 reads
This script will save your database permissions into a table.
2025-12-29
729 reads
This script is used to generate the output file as CSV format for list of server.
2025-11-03 (first published: 2025-10-20)
1,127 reads
The script gets the database health check whether synchronized or not from the primary or secondary. This code needs to scheduled through as a job to get alerts.
2025-10-20 (first published: 2025-10-13)
874 reads
Get a list of all user permissions in a database
2025-10-15 (first published: 2025-10-13)
2,375 reads
Two PowerShell scripts to create backup folders and clean up old files.
2025-08-29 (first published: 2025-08-16)
482 reads
This script will help to find orphan users on all databases and will remove them.
2025-05-20
717 reads
2025-05-06
1,209 reads
This script runs a SQL server Health check for services, databases, Always On, replication, CDC job status.
2025-05-05
1,548 reads
By Steve Jones
I was experimenting with CHOOSE() recently after I was asked a question. In a...
By DesertDBA
I did not expect 27 responses to my T-SQL Tuesday #204 invitation, but it...
Should you adopt an off-the-shelf AI tool, partner with a specialist, build in-house, or...
Has anyone ever seen this before? I have sysadmin permission on a server. I...
Comments posted to this topic are about the item Switching Schema II
Comments posted to this topic are about the item A Practical Approach to Automating...
I run this query:
SELECT s.name AS schemaname , o.name AS objectname FROM sys.objects o INNER JOIN sys.schemas s ON s.schema_id = o.schema_id WHERE o.name = 'Beer'I get two rows back for the objects, named dbo.beer and etl.beer. Both the tables have identical schemas and are not partitioned. There are 25 rows in dbo.beer and 0 rows in etl.beer. I run this code:
ALTER TABLE dbo.beer switch TO etl.beerWhat happens? See possible answers