Generate index on foreign key columns
Script find all foreign key without index in database and create new one for them.
2012-03-29 (first published: 2008-01-25)
3,401 reads
Script find all foreign key without index in database and create new one for them.
2012-03-29 (first published: 2008-01-25)
3,401 reads
Find why SQL Server clustered index design should be narrow and static and how clustered indexes affect many-to-many tables to improve database performance.
2008-01-16
3,939 reads
Indexes directly affect the performance of database applications. This article uses analogies to describe how indexes work. The estimated execution plan feature of the Query Window is utilized to compare the performance of two queries in a batch.
2007-12-04
5,686 reads
2007-12-21 (first published: 2007-10-25)
1,425 reads
This is an enhanced version of my previous script: Prioritize Missing Index Recommendations (2005).To aid in evaluation of whether the recommended index is reasonable, I have added :1. counts for key columns and the total columns of the recommended index 2. the length/bytes for both key and all columns Note this is 'per row', not […]
2007-08-17
1,858 reads
To report indexes proposed by the database engine that have highest probable user impact. Note that no consideration is given to 'reasonableness' of indexes-- bytes, overall size, total number of indexes on a table, etc. Intended to provide targeted starting point for holistic evaluation of indexes.
2007-08-17
993 reads
This script will find foreign keys (on referencing table) that are not indexed in SQL Server 2005.
2011-12-20 (first published: 2007-08-10)
3,764 reads
Check Indexes on all databases and rebuild/reindex based on fragmentation
2008-02-01 (first published: 2007-04-05)
1,467 reads
2007-04-30 (first published: 2007-04-03)
1,691 reads
Since it is not possible to script only the primary keys of all tables with the SQL Server 2005 Management Studio, here a small script to get the create scripts for all existing primary keys of the current database.
2007-03-28 (first published: 2007-03-09)
4,305 reads
By Steve Jones
I wrote about learning today for the editorial: I Can’t Make You Learn. I...
By ReviewMyDB
Fabric has CI/CD built in, but if you've tried to use it for database...
By Steve Jones
attriage – n. the state of having lost all control over how you feel...
WA:0821-4447-7715 Jl. Sentra Niaga Jl. Harapan Indah Boulevard Kav. CP2 No. 1, RT.10/RW.8, Pusaka...
WhatsApp:0821-8154-398 Jl. Yos Sudarso No.27, Lemahwungkuk, Kec. Lemahwungkuk, Kota Cirebon, Jawa Barat 45111
WhatsApp:0821-8154-398 Jl. Inspeksi Kav. PTB Blok A 2 No. 2 C-D, RT.1/RW.4, Pd. Klp.,...
In SQL Server 2025, I have a table (dbo.UserPermission) that contains this data:
UserID UserPermissions 15 23 37 4 NULLWhat is returned when I run this code:
select bit_count(UserPermissions) as PermissionCount from dbo.UserPermission where UserID = 4;See possible answers