Run these commands on the master table. First get the existing rules Based on the above query if there are any rules you need to remove get the name and replace Client with the appropriate name If you need to add an IP rule go to https://www.kittell.net/ip.php and update the script below with what is …

Sometimes you really just need to know how many users you have on your database, the below script will give a quick report for your database. Note: This script is designed to run on a selected database, you will have to select the database first and then run the script.

In this example I create a Read-Only user but this will work with any access as long as you change the db_datareader access role to what you need In SQL Management Studio open a “New Query” with [master] database Again in SQL Management Studio open a “New Query” with the specific database you want to …

Scenario: You have to tables with similar information and you need to see what is different Say Table1 & Table2 are two sales contact tables and you want to combine the tables See SQLFiddle for the data schema to allow you to test the queries below. In each example it is assumed that Table2 is …

Recently in a project to list all the plugins in a WordPress site with their versions I had accidently added .0 on to various rows in error. This script was very helpful to correct this error Reference: http://stackoverflow.com/questions/10470471/delete-last-n-characters-from-field-in-a-sql-server-database

Version Delimiter

Reference: Laurence @ http://stackoverflow.com/questions/13315756/how-to-compare-sql-strings-that-hold-version-numbers-like-net-system-version-cl

If you have ever started a new job and we told to “Dig into the database and learn” these scripts likely have come to mind whether or not you knew/know them. References & Credit: http://www.pinaldave.com/ / http://blog.sqlauthority.com/ https://www.simple-talk.com/sql/database-administration/exploring-your-sql-server-databases-with-t-sql/