What is xp_cmdshell used for, and how do you run a batch file using T-SQL? Examples run a system command, a plain BAT file and one with a parameter.
SQL SERVER – 2005 List All Tables of Database
The simple way to list all tables of a database in SQL Server 2005: select from sys.tables to get every table that users have created.
SQL SERVER – Explanation and Example Four Part Name
What is a four part name in SQL Server? It is ServerName.DatabaseName.DatabaseOwner.TableName, for example localhost.AdventureWorks.Person.Contact.
SQL SERVER – Repeate String N Times Using String Function REPLICATE
REPLICATE repeats a string N times. I found this T-SQL string function while searching for replication, and it is handy when you need repeated text.
SQL SERVER – Explanation and Comparison of NULLIF and ISNULL
NULLIF returns NULL when two expressions are equal and the first one when they are not. Here is how it compares with ISNULL and the matching CASE expression.
A Simple Dashboard From DMVs
A dashboard from DMVs can show live requests, database state, waits, and backups when its queries refresh without adding load.
Current Date and Time in SQL Server: GETDATE, SYSDATETIME and More
You can read the current date and time in SQL Server in eight ways, and they differ in precision and time zone. This post runs them side by side, shows that each one is evaluated once per statement, and picks the right one for defaults, audit columns and reports.







