SQL SERVER DISABLE INDEX
Use the script below to disable an index on a SQL Server table
ALTER INDEX MY_INDEX_NAME on MY_TABLE_NAME DISABLE;
Executing the...
2012-01-03
1,453 reads
Use the script below to disable an index on a SQL Server table
ALTER INDEX MY_INDEX_NAME on MY_TABLE_NAME DISABLE;
Executing the...
2012-01-03
1,453 reads
Look at the following 3 scripts:
-- 1. Hardcoded
SELECT
*
FROM
Sales.Orders
WHERE
DateAndTime < '19900101'
-- 2. Variable
DECLARE @FilterDate DATETIME = '19900101'
SELECT
*
FROM
Sales.Orders
WHERE
DateAndTime...
2012-01-02
469 reads
It’s the first Monday of January and for most of us it’s probably a vacation day. No fear, you can...
2012-01-02
1,014 reads
To change the collation of an database following commands can be used:
ALTER DATABASE [database name] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE [database name] COLLATE Newcollation
ALTER DATABASE [database name] SET MULTI_USER
For example , suppose if the name...
2012-01-02
2,352 reads
To rename a column in a SQL Table following command can be reused:
SP_RENAME 'old table name', 'New table name'
For example,...
2012-01-02
1,860 reads
Goal Setting
Last year, I did a wrap up post of the year to see where I landed from where I...
2012-01-02
996 reads
The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.
Here’s an excerpt:
The concert hall at the Syndey...
2012-01-02
749 reads
Fragmentation of an index can severely affect performance. When logical ordering of the key within a page does not match...
2012-01-02
1,012 reads
I have been renewed as an MVP for SQL Server. This is my 4th award. It's humbling to receive the...
2012-01-02
1,265 reads
I received my fourth (or fifth?) renewal notice as a Microsoft MVP this morning. I am proud to be recognized...
2012-01-01
938 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...
Nitazoxanide 500 mg Buy Online is a search term used by people looking for...
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...
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