SQL Server Search all String Columns in 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.
Valuable SQL Server Scripts tips, tutorials, how-to’s, scripts, and more for SQL Server Developers.
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.
In this article we look at various T-SQL scripts that can be used to generate SQL Server object structures in JSON format.
In this tip we look at why you might get errors with scripts that work fine in SSMS, but not with sqlcmd.
Learn how to use a SQL Server CTE and XML to determine recursion in your data. For example, a hierarchy of employees in a company.
Learn how to resolve the SQL Server Common Table Expression CTE MAXRECURSION problem by configuring the parameter for each query.
The requirement is to create an easy way to generate an HTML table as output for a SELECT query. With this tool you can create quick and simple HTML reports.
I created this script as a quick way to attach a bunch of SQL Server databases to a new instance where I just had the MDF files from a SQL Server instance.
CodePlex is going away and in this tip we look at how to more your projects from CodePlex to GitHub.
Your SQL Server drives are running out of disk space and you want a way to quickly tell which sub-directories are taking the most space. In this tip we will look at some T-SQL code that you can use to find potential issues.
In this tip we show a script that can be used to find the oldest open transaction and the statement that was issued.

Use this script to find strings in all tables and all databases in a SQL Server instance.
In preparation for disaster recovery, I need to make sure I can recover the logins onto another server. In this tip we look at how to setup an automated process to script all SQL Server logins.
You wish to access OLE or COM objects, such as file system objects (files, folders) and their properties directly from SQL Server. This might be, for example, to load data automatically from a raw data source; to check for the existence of a directory bef
If you're the sort of person who can effortlessly write complicated queries in SQL using a single SELECT statement, please click away from this article now! However, if ( like me ) your brain spins in proportion to the complexity of the query you're writ
In this tip we look at a script that identifies all orphaned users for all databases on a SQL Server instance. The script can both identify and drop the orphaned users.

In this article we look at 4 different ways to get rows counts for all tables in a SQL Server database.
While the system procedure sp_MSforeachdb is neither documented nor officially supported, most SQL Server professionals have used it at one time or another. This is typically for ad hoc maintenance tasks, but many people (myself included) have used this t
There are times when you need to loop through all the databases or database objects to perform some tasks. The simplest approach would be to create a cursor. In this tip we take a closer look at the built-in commands to allow you to do this.
You have configured your database backup jobs without any problems. The backups themselves seem to be working, but are the files still where you think they are? How do you know they have not been moved, or worse, deleted to free up some space on your serv
In this tip we look at scripts that will list all columns and attributes for every table in a SQL Server database.
This article will help developers looking for a way to split delimited strings in a single query using XML.
This article includes a script to auto generate T-SQL code to build an UPDATE trigger to track any changes from the main table into an audit table.
One thing that frustrates me is that sometimes I write these great queries, but often forget to save them or can't remember exactly what the query looked like that I ran five iterations ago. One smart thing to do would be to always save your scripts, but
In a previous tip, Searching and finding a string value in all columns in a SQL Server table, you showed how to find a string value in any text column in any table in a database. I was wondering how this can be taken a step further to allow a replacement