SQL Server Admin Role Alert Script
The below code will send an email alert when someone is added to the SYSADMIN Role on your SQL Server
2024-07-26 (first published: 2024-07-16)
1,025 reads
The below code will send an email alert when someone is added to the SYSADMIN Role on your SQL Server
2024-07-26 (first published: 2024-07-16)
1,025 reads
We decided to build a quick worker thread alert so we know when we are near the limits.
2019-05-02
1,603 reads
The below script will build a csv file for import of the servers Power Plan Setting.
2018-11-06 (first published: 2018-10-19)
587 reads
Some short & sweet PS code to add databases on AG Node 1 to AG Node2 and snap them in.
2017-09-12 (first published: 2017-09-07)
995 reads
Keeps a memory leak under control until the bug fix is developed and applied. Short term band aid.
2017-04-25 (first published: 2017-04-13)
555 reads
The code works well for an automation process that needs to have xp_cmdhsell turned on.
2017-02-22 (first published: 2017-02-13)
1,610 reads
Decryption Timer to let you know when the removal of encryption for a TDE encrypted database has completed to perform a backup of the data after masking.
2017-01-24 (first published: 2017-01-18)
461 reads
If you have job that opens a transaction and hangs too long causing a Prod issue this will be a big help to let you know.
2016-04-22 (first published: 2016-03-30)
723 reads
This was used to alert on VLF counts to high due to replication log reader having issue reading the transaction log.
2016-03-17 (first published: 2016-03-02)
908 reads
Running the sp_change_users_login @Action=Report against all databases with a simple cursor wrapped around it.
2016-02-23 (first published: 2016-02-04)
1,299 reads
If you spend your days tuning queries, managing pipelines, or keeping a production database...
I’ve been rebuilding my three-site SQL Server demo lab, and I ran into something...
By SQLPals
SQL Server gMSA: Why DBAs Still Aren't Using It in 2026 ...
Comments posted to this topic are about the item Never is Not the Policy
Comments posted to this topic are about the item Automating SSAS Multidimensional Security Audits...
Comments posted to this topic are about the item Rebuilding All Indexes
I have added a few indexes to one of my tables in SQL Server 2025:
ALTER TABLE dbo.CustomerContact
ADD CONSTRAINT PK_CustomerContact
PRIMARY KEY (CustomerID);
-- Create index on CustomerEmail
CREATE INDEX IX_CustomerContact_CustomerEmail
ON dbo.CustomerContact (CustomerEmail);
CREATE INDEX IX_CustomerContact_CustomerEmail
ON dbo.CustomerContact (phone);
I then do this to disable one index:
alter index IX_CustomerContact_CustomerPhone on dbo.CustomerContact disableI see this when I check the index status:
I decide to rebuild all indexes with this command:
ALTER INDEX ALL ON dbo.CustomerContactAfter I do this, what will I see for the index status? See possible answers