Search all String Columns in all SQL Server Tables or Views
In this article we look at T-SQL script you can use to search for a string in every table and view in every database or in a specific database.
2022-05-30
In this article we look at T-SQL script you can use to search for a string in every table and view in every database or in a specific database.
2022-05-30
Learn how to execute the same batch of SQL Server commands X number of times using the GO command.
2021-08-27
Sometimes there is a need to find if a string value exists in any column in your table. This script will help you find all occurrences in all columns in the table.
2020-09-25
What to do when you have several sql scripts to run in your DB? Put all in a folder and use this...
2018-02-09 (first published: 2018-01-24)
2,278 reads
A great script that I wrote some time ago to allow the last database backup to be restored across a linked server to another server, after running a remote sproc on the destination to kill off any users on the receiving side.
2016-03-14 (first published: 2016-02-25)
895 reads
This script is a universal foreach stored procedure. You can loop through everything with the help of if.
2013-09-24 (first published: 2013-09-10)
1,862 reads
SQL Server Management Studio is where most SQL scripts and queries are run, and although it does a decent job, it doesn't provide much help storing, sharing and managing the scripts particularly in the context of a team. Red Gate is considering building functionality into SSMS to help its users consume and share queries and scripts. Please help us by completing this short survey to help us define the requirements.
2013-04-12
3,832 reads
One of the new cool features in SQL 2012 is the SQL Server Availability groups. In other words being able to failover a group of databases which are logically connected. i.e. SharePoint databases. Well, it is also possible to do that in SQL 2008 (R2). It’s called a Grouped Failover.
2013-01-24 (first published: 2013-01-16)
626 reads
By Brian Kelley
During COVID, I attended training on software/enterprise architecture given by Mark Richards. One of...
For me, the objective is straightforward: have a backup strategy that is reliable, understandable,...
By DesertDBA
Note: This post is the invitation for T-SQL Tuesday #204 on November 3rd, 2026....
Jl. Asia Afrika No.122-124, Paledang, Kec. Lengkong, Kota Bandung, Jawa Barat 40261
Jl. S. Parman No.66, Kebun Kenanga, Kec. Ratu Agung, Kota Bengkulu, Bengkulu 38223
Jl. Raya Koba, RT.019/RW.007, Dul, Kec. Pangkalan Baru, Kabupaten Bangka Tengah, Kepulauan Bangka Belitung...
On SQL Server 2025, I run this code as a sysadmin:
CREATE LOGIN Demo WITH PASSWORD = 'Demo1234567' GO ALTER SERVER ROLE ##MS_DatabaseConnector## ADD MEMBER Demo GOI then login as Demo and run this:
USE sandbox go SELECT CURRENT_USERWhat is returned? See possible answers