2016-03-03
488 reads
2016-03-03
488 reads
This Script can be used to pick out a temporary table from tempDB
you might want to Check and drop the table before you create it just in case , but I Haven't included it here
2016-03-01 (first published: 2012-12-07)
1,833 reads
Following script retrieves the queries currently executing on the server.
2016-02-29 (first published: 2014-09-04)
3,415 reads
We can check for null values using count.
2016-02-26 (first published: 2016-02-16)
1,201 reads
SQL Agent job to cleanup all old text files on the errorlog directory.
2016-02-25 (first published: 2016-02-23)
487 reads
If you need to change multiple SQL Server Services accounts across your environment, Powershell can do that for you.
2016-02-24 (first published: 2016-02-19)
6,784 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,322 reads
Script finds char types columns defined to allow NULL values but have non NULL values and generates the ALTER statements for the changes.
2016-02-22 (first published: 2016-02-08)
1,054 reads
Gives execute permission on all user-defined types for the specific user
2016-02-19 (first published: 2016-02-03)
865 reads
To show SQL Server and physical server details upon instance restart so that we have visibility of unexpected issues with servers and services.
2016-02-18 (first published: 2016-02-04)
764 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