Scripts

Technical Article

Generate views to correct the column collation on a target DB's tables automatically

You find you are querying a vendor supported database where you're not allowed to make any collation changes, and which has a weird collation setup: default DB collation that matches your server and other databases all character related columns are explicitly a different collation that does not match your DB or server collation Rather than […]

You rated this post out of 5. Change rating

2019-07-05 (first published: )

4,197 reads

Technical Article

Audit Users logging in using "sa" or service accounts

Security is probably one of a production DBA's most important tasks and if developers use application or service accounts to run queries in your production environment you need to identify then and prohibit it. I notice some unwanted activity after staring a new job and decided to create a script that notifies me via email when […]

You rated this post out of 5. Change rating

2019-07-04 (first published: )

2,065 reads

Technical Article

Backup Database Size calculation Report - Monthwise

The script helps to calculate the size of the backup of the databases monthwise. This will help to understand the database growth rate from the backup file if we do not have any data collection utility to find the exact details of the DATA File growth.

5 (1)

You rated this post out of 5. Change rating

2019-05-03 (first published: )

1,577 reads

Blogs

Free webinar – Tackling the Gaps and Islands Problem with T-SQL Window Functions

By

I’m hosting a free webinar at MSSQLTips.com at the 19th of December 2024, 6PM...

Counting Groups with Window Functions: #SQLNewBlogger

By

I looked at row_number() in a previous post. Now I want to build on...

Read the latest Blogs

Forums

A Few Good DBAs

By Rod Weir

You can't handle the truth!!  (about data integrity) A few good database administrators https://www.helpmasterpro.com/blog/a-few-good-database-administrators/...

Python with SQL 2022 Enterprise doesn’t work

By VK_Carry

I have installed Machine Learning with SQL 2022 Enterprise Edition and installed and configured...

A Guide to SQL Security in Django

By omu

Comments posted to this topic are about the item A Guide to SQL Security...

Visit the forum

Question of the Day

Incremental Statistics

I have run this on SQL Server 2022 for the Sales database:

ALTER DATABASE Sales SET AUTO_CREATE_STATISTICS ON (INCREMENTAL = ON)
I then run this in the Sales database:
USE Sales
GO
CREATE STATISTICS CustomerStats1 ON dbo.Customer (CustomerKey, EmailAddress) WITH INCREMENTAL = OFF
The dbo.Customer table is partitioned. How are statistics created?

See possible answers