Each SQL Server database administrator and database developer has a set of scripts that should always be somewhere close. One of them is the one that kills a bunch of connections to a database. It can be a group of all connections, those made by a particular login or the ones using a specific database. No matter what actual conditions are, killing dozens or hundreds connections manually is not fun. Here are provide an SQL script that can be easily customized to cover a specific need. The below version destroys all non-background connections to a database called MyDatabase.
Database development environment with Windocks and Liquibase
I cannot imagine a project in a reputable company without a development environment. A place where developers could deploy unfinished code, test it, play with it or do ad-hoc manual changes without making any trouble to their colleagues. All projects have such place you could say. Not really I would respond.
Forget about BINARY_CHECKSUM in SQL Server!
SQL Server has a few functions that allow calculating a hash from a single value or multiple values. They could be very useful if they worked reliably. Unfortunately, they do not. This article shows how to use CHECKSUM and BINARY_CHECKSUM functions and why you should not rely on them. And I do not only mean the collision probability!
Why my view does not show this column?
When using SQL Server you may have an impression that not everything works exactly how you would expect. One of those things may be a view that does not contain a column that you added to the source table. In this article I will explain you why it works like that and how to refresh columns in the view.
Problems with sp_rename
Unsupported or undocumented functions are not surprising in IT software. SQL Server also has some, for example very useful sp_who2. If it suddenly stops working, do not blame Microsoft - they have never encouraged you to use it. Leaving undocumented commands behind, there are also stored procedures that are well documented and supported but not recommended to use. One of them is sp_rename which I am writing about.
- Script to shrink tempdb
- What?! SELECT query caused a deadlock?
- What port is SQL Server running on?
- Microsoft announces SQL Server on Linux
- String functions - SQL Server, Oracle, MySQL differences
- Loading all files from directory to table
- Data Science with Microsoft Azure Machine Learning, Microsoft SQL Server and R
- FILESTREAM in SQL Server 2014 - practical introduction video
- Clean SQL Server cache
- FILESTREAM performance test
- Introduction to FILESTREAM
- How much can sparse columns help to save disk space?
- How to find a text in a database
- Full-Text Search with PDF documents in SQL Server 2014
- len vs datalength - measuring data size
- Changing a schema of an object in SQL Server
- Nesting transactions and SAVE TRANSACTION command
- Shredding XML to tables with OPENXML
- Filtered indexes
- Generating XML from SQL - part 2
- Generating XML from SQL - part 1
- ORDER BY and NULLS LAST in SQL Server
- SQL Server 2014 vs 2012 - performance test
- Is OFFSET FETCH NEXT optimized in SQL Server?
- Delayed durability in SQL Server 2014 - performance test [video]
- Delayed durability in SQL Server 2014
- IDENTITY vs sequence - performance test
- New window functions in SQL 2012: LAG, LEAD
- Window aggregate functions in SQL 2012
- Checksum vs Torn Page Detection - performance
- Full-Text Search - practical introduction [video]
- Testing T-SQL script before execution
- Moving Transaction Log file to a different location
- Checking current IDENTITY value
- Script to find amount of free space in datafiles
- View deadlock details in Error Log
- Configure colors for db connections [video]
- Restore a backup on lower version of SQL Server
- Find the biggest database on an instance