Dropping a Database
I came across an issue on a server this morning where a drive had run out of free space. Now given...
2012-01-03
620 reads
I came across an issue on a server this morning where a drive had run out of free space. Now given...
2012-01-03
620 reads
I’m in the middle of a database migration and thought I’d quickly share a script I threw together to show...
2012-01-03 (first published: 2011-12-30)
81,262 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,448 reads
The first week following on from the Christmas break is a very hectic one for us Data Professionals.
Your customers are...
2012-01-03
629 reads
I ran across a thread recently where someone was asking how to get the Windows start time from within SQL...
2012-01-03
1,082 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,337 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,849 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,012 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
446 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,263 reads
By Steve Jones
I wrote about learning today for the editorial: I Can’t Make You Learn. I...
By ReviewMyDB
Fabric has CI/CD built in, but if you've tried to use it for database...
By Steve Jones
attriage – n. the state of having lost all control over how you feel...
I have a need to execute a stored procedure and return the results to...
Title pretty much says it all - can this be done? I've tried several...
Comments posted to this topic are about the item BIT_COUNT II
In SQL Server 2025, I have a table (dbo.UserPermission) that contains this data:
UserID UserPermissions 15 23 37 4 NULLWhat is returned when I run this code:
select bit_count(UserPermissions) as PermissionCount from dbo.UserPermission where UserID = 4;See possible answers