Ever wondered how to script the object’s definition directly in T-SQL (like you do in SSMS with “Script [object] as CREATE To”?
Here is a useful script when you want to check your SQL Server uptime and last start date directly from TSQL. It will also check if the SQL Server Agent is running.
Do you find yourself in the situation where you want to audit or check what is happening with your server in terms of queries? Or maybe you are in a more unpleasant situation and you need to recover a query after a SQL Server crash or a server crash. Either way, the following script will Read More
Trying to figure out what jobs are running and what their status is can be an easy thing when you have only a few that can overlap at certain times. But when you are overwhelmed by a lot of jobs and you want to keep a track of the ones that are currently running, you Read More
You can use this script to truncate tables: When you want to clean all tables in a database/schema but keep the design and not recreate the objects During the initial testing period or early stages of a database design
Grouping sets in SQL Server always comes into handy when you find yourself in the need to perform data aggregation based on groups. The groups are made by defining a set of attributes that the engine will use to split the data.
The following script will help you to get all the columns with different collation than the one specified as default for a database.
Getting a list of current backup and restore processes running on your system comes in handy when a lot of people are working on the same environment (and work can overlap) or when you have many automatic backup tasks and want to see which ones are currently running and the time to completion. Don’t be Read More
You can easily find yourself in the need to know the tables with no existing rows from a database, especially in data warehousing scenarios.