Category: Database

MySQL Docker Container

################### Dockerfile Build Method ######################mkdir /var/lib/docker/mysql && cd /var/lib/docker/mysqlvim Dockerfile################## Dockerfile contents ###################### Derived from…

SQL: Exists Condition

The EXISTS condition is considered "to be met" if the subquery returns at least one…

SQL: DELETE FROM Statement

DELETE FROM `Profiles` WHERE Picture = '0'--------------------------------------------------Change password to "sexcenter"UPDATE `Profiles`SET Password = '5863294bde549649adab89940c3e09ea'WHERE Password…

Web Server Files and mySQL backup and restore

Backup: mysqldump -u [username] -p [password] [databasename] > /home/shares/backup_db.sql   Restore: mysql -u root -p…

Gallery2 Random Highlight Mod

There's a SQL technical limitation where one may not update a table based on its…

MySQL Update Statement

UPDATE _vldmembers_data_membersSET data_gender2=3WHERE data_gender1=1;UPDATE _vldmembers_data_membersSET data_state=469WHERE data_city LIKE 'Kansas%';UPDATE _vldmembers_data_membersSET data_state=457WHERE data_city LIKE 'colorado%';UPDATE _vldmembers_data_membersSET…

MySQL: update with Join Tables

Let's say for example you have a product table which stores information about products and…

SQL replace character in string

update g2_Item set g_title = replace(g_title, '_', ' '); update g2_Item set g_title = replace(g_title,…

DB2 AS400 to Microsoft SQL Conversion

SQL Ways Wizard: Enter ODBC data source, username, and password >> press Next Set Target…

MS SQL Maintenance

Below is a list of practical SQL snippets to administer Microsoft databases: -- Shrink Database:…

Microsoft SQL: Force ReportServer database out of being stuck in recovery mode

Error: ALTER DATABASE is not permitted while a database is in the Restoring state. Should…

SQL Admin

How to Trace Deadlocks:SQL Management Studio >> Tools >> SQL Profiler >> log in >>…

SQL Server Overview

SQL Buffer Manager (Cache) 8K Pages between memory and disk storage 8 Pages = 1…

MySQL: List Database Size

SELECT table_schema "kimconnect",        ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in…

Microsoft SQL AlwaysOn High Availability Cluster Management Tool

There are some bugs in the script. I'm too lazy to go back a fix…

How to Add a Replica into an Existing Availability Group using PowerShell

Overview:0. Add secondary replica to the cluster by running some commands on the availability group…

SQL Failover (Simple Method)

$servers="SQL01","SQL02","SQL03"; # Dynamic Credential method 1 $who = whoami if ($who.substring($who.length-2, 2) -eq "-admin"){$username=$who;} else…

SQL AlwayOn High Availability Default Port

Internal SQL DEV & QA environments may have SQL listening to the default port of…

Check Servers NSLookup of a Listener to Match Active Node IP

$servers="SQL01","SQL02","SQL03","SQL04" $listener="halistener01" $activeNode="10.10.10.5" # Dynamic Credential method 1 $who = whoami if ($who.Substring($who.length-2, 2)="-admin"){$username=$who;} else…

Microsoft SQL AlwaysOn Unabridged Notes

Following is a brain dump of the trials and errors in troubleshooting MS-SQL AlwaysOn High…