SQL Server

SQL Server - T-SQL Script to Backup All Databases

The SQL Server Agent and database maintenance plan wizards are unavailable in SQL Server Express, so a quick and easy way to backup all databases on a schedule is to call a T-SQL script using Windows Task Scheduler. The sqlcmd program can be called from a task to execute the script on SQL Server 2005 or greater and osql can be called on SQL Server 2000. To get to Windows Task Scheduler open the Run dialog box in Windows and enter "control schedtasks".

SQL Server - Search for String in All Tables of Database

In the article Oracle PL/SQL - Search for String in All Tables of Schema I promised to show how to search for a string in all tables of a SQL Server database using T-SQL. Replacing the @SearchStr variable in the script below will perform a case-insensitive search for the string in all tables not shipped with SQL Server in the current database. The script searches every column and will report the exact column where a match is found, but this could run quite slowly if you have many large tables.