SQL Server – Kill all sessions using database
Before an existing database can be restored, there should be connections using the database in question. If the database is...
2013-11-25
97 reads
Before an existing database can be restored, there should be connections using the database in question. If the database is...
2013-11-25
97 reads
Stuff function: - This function is used to replace string from the given start position, passed as 2nd argument with string...
2013-11-25
34,551 reads
Quick script just to give you an idea of how your databases are being used. Mainly useful for exploring.
select db.name...
2013-11-25
8,903 reads
Well, do you know? You’re the DBA, the guy in charge, the guy who gets pounced on first thing in...
2013-11-25
899 reads
Introduction
A few days ago, I did a presentation for a Virtual Chapter meeting where I discussed SQL Server Data Access...
2013-11-24
957 reads
Backing up SQL Server Databases
Backing up your SQL Server database is essential for protecting your data. The word Backup refers...
2013-11-23
3,211 reads
(Be sure to checkout the SQLpassion Online Academy, where you get High-Quality SQL Server Trainings with Instant Access!)
Today I have...
2013-11-23
1,658 reads
If you’re a training provider and I’ve missed you, please drop me a line at brian {dot} kelley {at} sqlpass...
2013-11-22
355 reads
It’s Friday, time to look back at the most popular RealSQLGuy posts of the week. Because it’s Friday and you’re...
2013-11-22
471 reads
Nothing exciting, just a general script. How can you see what heaps you have laying around?
exec sp_MSforeachdb @command1 ='
use [?]
SELECT...
2013-11-22
896 reads
By Brian Kelley
Fabiano Amorim has written an excellent article at Simple Talk on securing msdb. Here's...
By Steve Jones
This month we have a new host, which I am grateful for. So many...
I needed to do some research because there is more to #temp tables than...
Comments posted to this topic are about the item OUTER APPLY Fundamentals: Part 2
Comments posted to this topic are about the item Building Great Software
Comments posted to this topic are about the item The Range of Customers
I have this data in the OrderHeader table in a SQL Server 2025 database (ordered by CustomerID ASC):
orderid orderdate customerid complete 3 2025-05-10 00:00:00.0002 1 21 2024-01-10 00:00:00.0003 1 15 2023-10-28 00:00:00.0004 1 13 2025-03-08 00:00:00.0006 1 11 2024-04-02 00:00:00.0007 1If I run this query, how many rows are returned?
SELECT * from dbo.OrderHeader where customerid between 3 and '6'See possible answers