Detaching and Attaching a Database
Detaching and attaching a database is an advanced trick that can be useful in anything from transporting your database to recovering from a disaster.
2001-05-10
17,148 reads
Detaching and attaching a database is an advanced trick that can be useful in anything from transporting your database to recovering from a disaster.
2001-05-10
17,148 reads
Have you ever worked with an application that forgot to close its connections? Ever run out of connections on your SQL Server and had to manually go remove the ones that are not in use? This article will present a technique for keeping the database clean.
2001-05-07
5,216 reads
One of the most handy extended stored procedures in SQL Server is xp_cmdshell. This article will show you how to use it.
2003-11-14 (first published: 2001-05-03)
39,711 reads
This article by Andy Warren talks about using sp_addlogin to move logins from one server to another. It also points out a problem you may run into if you have a SQL 7 server that was upgraded from 6.5
2004-05-12 (first published: 2001-05-01)
10,984 reads
How can you maintain a stable environment? Keeping track of all changes is the time-tested and proven technique. Read about it here.
2001-04-30
5,475 reads
This article shows you in a step-by-step manner how to restore the master database.
2001-04-29
9,009 reads
The eighth part of Steve Jones's series on having SQL Server automatically report information to a DBA.
2001-04-29
6,833 reads
Everyone needs a stable environment. This article discussed ways to keep your team on the same page.
2001-04-25
5,860 reads
The sixth part of Steve Jones's series on having SQL Server automatically report information to a DBA.
2001-04-25
5,780 reads
The fifth part of Steve Jones's series on having SQL Server automatically report information to a DBA.
2001-04-24
7,078 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...
Telp/Wa 628218200203 Gedung Sutrado, Jl. Kenari 2 No.5 Lt. 1, RT.2/RW.3, Kenari, Kec. Senen,...
Telp/Wa 628218200203 Jl. Biak No.44 AB, RT.8/RW.11, Cideng, Kecamatan Gambir, Kota Jakarta Pusat, Daerah...
Telp/Wa 628217555651 Gedung Plaza Bank Index Ground, Jl. M.H. Thamrin No.57 Floor Suite GF-21,...
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