Alter all/specific columns by double dynamic SQL
The script uses dynamic SQL twice
first to get the detail about the database structure and create ddl out of it
second to execute each DDL created
2015-11-03 (first published: 2015-10-07)
985 reads
The script uses dynamic SQL twice
first to get the detail about the database structure and create ddl out of it
second to execute each DDL created
2015-11-03 (first published: 2015-10-07)
985 reads
How to Paginate a query result set to keep from pulling the whole result set to the client side
2015-11-02 (first published: 2014-05-05)
3,727 reads
A set of queries which attempt to gather as much security-related information on a single database as possible.
2015-10-30 (first published: 2013-10-24)
5,731 reads
Provide list of Stored Procedures that have been changed in past 7 days.
2015-10-29 (first published: 2013-04-11)
3,594 reads
2015-10-27 (first published: 2014-07-08)
4,409 reads
2015-10-23 (first published: 2014-05-13)
3,745 reads
Calculating working hours can be painful due to all the variances that they imply. This function will calculate working hours between 2 dates which might include time. There's an option to use a holidays table that will vary in each environment.
2015-10-22 (first published: 2014-05-22)
3,752 reads
2015-10-21 (first published: 2013-12-26)
4,068 reads
Often when tracking down problems, you need to know if anything has changed recently, this script will tell you...
2015-10-20 (first published: 2013-05-30)
3,944 reads
2015-10-19 (first published: 2013-08-30)
4,395 reads
By SQLPals
Why sys.fn_dblog Is Undocumented And Why It's Still There Why sys.fn_dblog...
When I put together the invitation for T-SQL Tuesday #202, I wasn't sure what...
By Steve Jones
My life has some crazy travel stretches for sure. Between speaking, office visits, customer...
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