List all Usernames, Roles for all the databases.
Generates a list of ALL Users and their database Roles for all Databases (Or for a specific user).
2013-12-30 (first published: 2008-07-24)
45,390 reads
Generates a list of ALL Users and their database Roles for all Databases (Or for a specific user).
2013-12-30 (first published: 2008-07-24)
45,390 reads
This script is for the Generating a code block that makes it easier to grant various permissions on a group of objects qualified by specific Criteria.
2008-10-08 (first published: 2008-07-23)
1,344 reads
Here's a script, for killing a SPIDs against a particular database, here am using BIN as the database.
2016-12-02 (first published: 2008-07-17)
1,830 reads
We have a new author at SQLServerCentral.com, Muthusamy Anantha Kumar AKA The MAK, who starts a new series on the basics that a DBA needs to know. This installment walks over basic backup and restore.
2008-07-15
13,198 reads
To find a list of Tables (User or System tables)according to their size.
2013-01-02 (first published: 2008-07-10)
4,332 reads
2008-08-26 (first published: 2008-07-09)
855 reads
Find every object in every database owned by a particular Login.
2011-09-27 (first published: 2008-07-07)
11,409 reads
2008-08-27 (first published: 2008-07-03)
2,213 reads
2008-07-02
5,340 reads
This article describes how to generate the sp_who2 results including the query text for the spid.
2008-06-26
23,181 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