I have been using SQL Server for almost 10 years, and I just learned something new using the LIKE operator. You can search any single character within a specified range by using a bracket [ ]. Lets look below to see what I mean.
Continue reading SQL Server Like operatorCategory: Hints and Tips
Using dbatools to find orphaned files
A lot of times you will move a database file from one drive to another and then forget to delete the original. This takes up precious space and could be causing you low disk space. Using dbatools, you can easily find any orphaned files for 1 database or all of the servers in your estate.
Continue reading Using dbatools to find orphaned filesSSMS: Saving changes is not permitted error
I was trying to change the datatype of a field in one of my tables using SSMS, and I received the Saving changes is not permitted error. Read below to see how I was able to make the change.
Continue reading SSMS: Saving changes is not permitted errorSQL Server: TableSample clause
A quick way to get a random sampling of data from a table is to use the TableSample clause. Below I am going to show you some different ways to run queries using this clause.
Continue reading SQL Server: TableSample clauseT-SQL: Create a running total
Often when writing sql statements, you need to create a running total of a column. This is very easily done using the OVER clause.
Continue reading T-SQL: Create a running totalSql Server: Find the location your backups are going to.
A client of mine setup backups on their server and the jobs are running successfully, but the backups are not showing up in the backup location. Finding the location of any backup commands can be found using a simple sql statement.
Continue reading Sql Server: Find the location your backups are going to.Oracle: Database will not startup due to invalid parameter
Most DBA’s now have to take care of multiple database platforms and they all have their own set of commands. One of my Oracle databases would not startup due to an invalid parameter in the SPFILE. Read on how I was able to get the database back up and running.
Continue reading Oracle: Database will not startup due to invalid parameterUsing dbatools to import csv data to your database: Import-DbaCsv
Often you will get a “csv” file from someone to load into your Sql Server database. There are many ways to do this including: SSIS, using the import tool from SSMS, etc. Now there is another way using Import-DbaCsv from dbatools.
Continue reading Using dbatools to import csv data to your database: Import-DbaCsvUsing dbatools to check server disk space: Get-DbaDiskSpace
If you want to check how much free space you have on your Sql Server, you can just Remote Desktop in and check right? Yes, but I will show you an easier way using dbatools and a way to check multiple servers at once!
Continue reading Using dbatools to check server disk space: Get-DbaDiskSpaceUsing dbatools to check your most recent backup
In a previous post DBATOOLS.IO….A DBA timesaver/luxury, I showed you how to install and ran through a quick demo of a very useful tool called dbatools. It has over 500 very useful DBA commands and today I am going to show you one I use often that restores your last backup.
Continue reading Using dbatools to check your most recent backup