Transact-SQL (T-SQL) is Microsoft’s and Sybase’s proprietary extension to the SQL (Structured Query Language) used to interact with relational databases. T-SQL expands on the SQL standard to include procedural programming, local variables, various support functions for string processing, date processing, mathematics, etc. and changes to the DELETE and UPDATE statements.

Transact-SQL is central to using Microsoft SQL Server. All applications that communicate with an instance of SQL Server do so by sending Transact-SQL statements to the server, regardless of the user interface of the application.

Is database part of an Availability Group?

Check databases membership in Availability Groups. This very nice handy script from Dimitri Janczak can help you in various situations when dealing with Availability Groups. You can handle conditional logic...
Read More

Set Single-User mode

Set database to SINGLE_USER mode do something and set MULTI_USER mode. Alter database mode using simple T-SQL statements....
Read More

Set Read-Only mode

Set database to read only mode do something and set read write mode. Alter database mode using simple T-SQL statements....
Read More

Set multiple database mode

Generate script for changing mode for multiple databases. In given script I'm setting databases to Single-user and back to normal stace. Then changing state to Read-Only and back to Read-Write,...
Read More

Update statistics for all databases

Easily update statistics with one line function. I know that you are maintaining statistics by some maintenance jobs scheduled to run on regular basis. You can use builtin Maintenance plans...
Read More

Index usage

Check how are your indexes doing in the database. This script is very useful when you are doing some performance optimizations by creating new indexes. Or trying to find some...
Read More

Index list

Get information about all existing indexes in given database. This script can be handful when you want to check all indexes with their create scripts and some of useful information...
Read More

Collect DBCC CHECKDB results

Get more more handful information about corrupted database. Best practice to check database consistency and integrity on regular basis to prevent more data damage will help you to find out...
Read More

Search for value

You want to find some value within whole database, in all tables and columns? You can use this script for searching of value in your database, I found it when...
Read More

Disk drives size

Returns information about space on disk drives used by databases in instance. This c an be handful in automation for example before creating or restoring new database. Also can be...
Read More