2008-11-25 (first published: 2008-10-20)
1,341 reads
2008-11-25 (first published: 2008-10-20)
1,341 reads
A quick script to check for fragmentation in a database and generate a list of defrag statments you can run.
2008-09-24
2,495 reads
2008-09-16
353 reads
Determining which columns to index in a table used to be a very time consuming process that was as much art as science. New author Ranga Narasimhan brings us an article that shows how SQL Server 2005 makes this much easier.
2010-07-23 (first published: 2008-09-16)
32,785 reads
Working with filegroups and managing the location of your various objects can be a cumbersome task in SQL Server. New author Thom Bolin brings us a technique and some code that worked well for one of his clients.
2008-09-15
6,296 reads
2008-09-03
3,679 reads
Statistics update date is stored as metadata on the SQL instance, but after a great deal of research against the system tables and DMVs I realized that this information is not readily exposed to the DBA via any other method than the STATS_DATE() function or the SQL Server Management Studio graphical user interface (GUI).
2008-08-12
3,021 reads
Reports stats on what the query optimizer records in the DMVs as missing indexes and what it says the cost savings will be if they were present. Can limit by table / schema name patterns.
2013-01-07 (first published: 2008-08-01)
21,377 reads
Gets single-column and cumulative-column selectivity stats and @Top largest dupe sets for each cumulative column stepping for a set of one or more columns for a table.
2008-10-24 (first published: 2008-08-01)
2,174 reads
Searches database-wide for multiple indexes in the same table which has the same column as the first seek key. Optionally limits to LIKE wildcard patterns of table and schema names.
2008-10-17 (first published: 2008-08-01)
3,374 reads
By Steve Jones
This is timely, as I’m currently on a boat in the Adriatic taking a...
You can find the slides and SQL scripts for my session “Spice up your...
By SQLPals
How to Clear the SSMS Cache (SSMS 21 and Later) Updated...
Comments posted to this topic are about the item Using CHOOSE()
Comments posted to this topic are about the item Re-Seeding a Broken Log Shipping...
Comments posted to this topic are about the item The DBA is Dead! Long...
We have this code that sets some status values and then queries them using the CHOOSE() function in SQL Server 2025.
CREATE TABLE Status
(
StatusID INT,
StatusDescription VARCHAR(20)
);
GO
INSERT dbo.Status
(
StatusID,
StatusDescription
)
VALUES
(0, 'Uncategorized'),
(1, 'Active'),
(2, 'Inactive'),
(3, 'Temp');
GO
SELECT CHOOSE(StatusID, 'Unknown', 'Active', 'Inactive', 'Temporary')
FROM Status;
When the SELECT runs, what is returned? See possible answers