Have you ever deleted a row of data and then needed to put it back due to being told it was the wrong row, but the table had an identity column and will not let you insert the row back? Using the Set Identity_Insert command, you can insert into the table.
Do you have files stored in your SQL Server database and need to see what they are. Here is a way using my favorite add-in SSMSBoost.
Here is an easy way to get (extract) all of the characters before a special character in a string. In our example we have a listing of email addresses and we want to get the name before the @domain.
Starting with SQL Server 2012, Microsoft has included analytic functions within the database. A couple that I use often, Lag and Lead, are very handy when you need to reference a previous or next row in a table without having to use self-joins or having to create a complicated sql statement.
Here is a useful technique to know. We have a delivery service and we want to know what hour of the day is most popular for completed deliveries. Using the DATEPART function, this can be easily calculated.
Here is a way to find out information about your SQL Server instance using TSQL. You can query all kinds of properties, for example, what edition are you running, what server is it on, etc.
You can also restore your SQL Server database using T-SQL instead of SSMS. Today I will show you how to do an easy recovery with restoring just a full backup and another scenario of restoring a full backup and any available transaction logs.