Reference: https://blog.sqlauthority.com/2011/06/18/sql-server-selecting-domain-from-email-address/
Category: SQL
Delphix Web API – PowerShell Run Masking Job
Take note of the Global Variables $BaseURL and $LogFilePath, make sure you set them to your values. The idea for this script is to run this as part of a database restore/migration. Drop all access to the database to do the restore/migration, then run the script for Delphix, and then…
Debian/Ubuntu LAMP Setup
The following code is for Debian 9 Stretch but should work on older Debian with minor changes
SQL – Select Closest Locations
This is an older script but still works nicely. Setup: You have a table with medical centers that has the address along with latitude and longitude columns. I used this script with a GPS application that pulled your current location and sent it to a web service to get the…
Azure MSSQL – Server Firewall Rules
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…
MSSQL – List Users With Permissions
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.
MSSQL – Datetime In Local Timezone
This function will get the local time based on the time zone difference from UTC
Microsoft Azure SQL – Create SQL User
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…
Azure – MSSQL Server Information
Same as MSSQL Server Information but is specific to what will work in Azure