MySQL – Different Methods to Know Current User

There are different methods to know the name of the current user in MySQL. There can be many reasons we want to know who is the current user. Here is list of the of the few of the such reasons.

Customized code which we want to run based on the reason.
Checking the permissions based on the user.
Inserting the name of the user in the audit table.
Displaying special message based on the login user.
Executing some special logic/code based on the logged in user.

Read More

MySQL – How to Drop Table If Exists in Database?

In this post SQL Server – 2016 – T-SQL Enhancement “Drop if Exists” clause, we have seen the new feature introduced in SQL Server version 2016. One of my friends recently asked me question that how to drop table in exists in MySQL database? It was not surprising to see that not many people know about the existence of this feature. MySQL already has this feature for a while and if you are MySQL DBA, you may find it interesting that SQL Server just introduced this feature.

Read More

SQL SERVER – Database Backup and Restore Management and Automation with ApexSQL Backup

ApexSQL Backup is a powerful yet simple tool for Microsoft SQL Server which represents a fully equipped command center for database backup and restore jobs management. It enables users to create and schedule backup related jobs (backup, restore, log shipping, index defragmentation…) and monitor all scheduled backup activities or overview complete backup history on multiple servers across the domain.

ApexSQL Backup is designed to create and work with native Microsoft SQL Server backups and databases, and supports all backup options which can be used in the SQL Server Management Studio and encompasses them in a simple and user friendly UI which revolves around simple wizards for each particular job.

Read More

SQL SERVER – View Dependencies on SQL Server: Hard & Soft Way

As an independent database consultant, I often face a challenge when analyzing the performance of SQL Server instances, which I see for the first time in my life. In many cases, this may seem a difficult task, because in order to fix something you must first understand the database structure. A great many of the companies do not document their database. And even if documentation exists, it is rarely updated. As a result, we have the following situation – documentation is either obsolete, or does not reflect the actual state of things. Let understand SQL SERVER – View Dependencies.

Read More

SQL Server Auditing and Recovery With ApexSQL Log 2016

ApexSQL Log is a powerful SQL Server transaction reader for forensic auditing and rollback of malicious and/or unintended changes for Microsoft SQL Server. It is an ideal cost solution for recovery, row changes and/or before-after auditing. ApexSQL Log uses technology which enables it to read online transaction log files or transaction log backup files in order to create auditing results including before and after views of the data as well as the full row history of all changes.

From the recovery standpoint, ApexSQL Log provides sophisticated undo/redo capabilities which enable it to create TSQL scripts which can be used to completely reverse or replay all or only selected transactions read from the online transaction log file and added transaction log backups.

Read More