Function to count set bits in a signed integer
This function counts the number of 1's in the binary representation of an integer.
2015-04-28 (first published: 2014-02-24)
989 reads
This function counts the number of 1's in the binary representation of an integer.
2015-04-28 (first published: 2014-02-24)
989 reads
Extract default & Named Instance from @@servername.
Print all characters before and after \ to find default and named instance name.
2015-04-27 (first published: 2015-04-15)
1,167 reads
2015-04-24 (first published: 2015-04-15)
1,212 reads
Check Status of a database. It will loop through all databases and will print message if the db is present.
2015-04-21 (first published: 2015-04-10)
1,333 reads
READ Data from default Trace to know when the objects are altered. If no database name is provided, it will run through all the databases.
2015-04-17 (first published: 2015-04-08)
1,431 reads
This script helps to identify which database/log takes most of the disk space and how much is free.
2015-04-15 (first published: 2013-06-18)
3,013 reads
Sometimes running DBCC CHECKDB WITH DATA_PURITY returns thousands of affected columns. This script automates the identification of those columns.
2015-04-13 (first published: 2013-07-04)
2,437 reads
Find any code objects that interact with a given table/view, or call another given code object.
2015-04-10 (first published: 2013-07-05)
4,641 reads
A stored procedure that will parse (shred) the contents of any well-formed XML document into a SQL table.
2015-04-08 (first published: 2013-07-09)
5,236 reads
One of the fastest ways to find out objects dependencies in SQL Server.
2015-04-07 (first published: 2013-07-29)
3,307 reads
By Steve Jones
Thanks to everyone that attended my sessions at VS Live San Diego yesterday. It...
By Steve Jones
I was creating a question on sp_readerrorlog and realized that this procedure is different...
By SQLPals
Why sys.fn_dblog Is Undocumented And Why It's Still There Why sys.fn_dblog...
Comments posted to this topic are about the item Implementing Type 4 Slowly Changing...
Comments posted to this topic are about the item The Disabled Index
Comments posted to this topic are about the item Server-Level Table sizes
I run this code on SQL Server 2022.
CREATE TABLE Drink
(
drinkid INT NOT NULL
CONSTRAINT DrinkPK PRIMARY KEY CLUSTERED,
drinkname VARCHAR(20),
rating NUMERIC(2, 1)
)
GO
INSERT INTO Drink
(
drinkid,
drinkname,
rating
)
VALUES
(1, 'Margarita', 4.5),
(2, 'Mojito', 4.3),
(3, 'Old Fashioned', 4.7),
(4, 'Martini', 4.4),
(5, 'Cosmopolitan', 4.2)
GO
ALTER INDEX drinkpk ON dbo.drink DISABLE
GO
SELECT * FROM dbo.Drink
GO
What is the result? See possible answers