SQL Programming: Saving/Listing each row in a SQL SELECT query results set

While debugging various enterprise management software’s that ship with a data hosted on SQL database, systems engineers requires to run various SQL queries to get the underlying information. While debugging the results returned from the query, one need to be able to observer each row returned by the SQL query. Here is quick way to […]

Advertisements

SQL Programming: Convert UTC Time to Local Time

Most of todays enterprise software’s get data gathered from workstations located various parts of the world that run in different time zones. To ensure the data integrity and proper processing of events/information, software’s rely on saving the date  data in UTC and then convert them at run time for reporting. When you have to run […]

Symantec Endpoint Protection (SEP) Reporting: SQL Stored Procedure to Generate Monthly Reports

It’s the security officers responsibility to overview the firm’s infrastructure risk exposure and trends in real time. Unfortunately, none of the industry leading security products has a feature to create a consolidated risk report that can help the top security officers to review and keep track with risk events. As I’ve great exposure into SEP […]

Setting Current_Timestamp/Datetime to field/column value in MySQL doesn’t work from Php using PDO connection.

Say in one of your table you have a field which you want to set with current time value from your database server. However, setting timestamp/datetime values from php to MySQL using PDO didn’t work for me in case of both NOW(), SYSDATE(), FROM_UNIXTIME(NOW()) The alternate/workaround, I found is to set MySQL default value for […]

Configuring UNIQUE constraint in MYSQL to avoid duplicate entries for a given column/field

MySQL Query: ALTER TABLE `MyLabDB`.`testusers` DROP INDEX `username` , ADD UNIQUE `username` ( `username` ) COMMENT ‘Avoid duplicate entries for username’; phpMyAdmin GUI:   After setting the Unique Index for the field, whenever a duplicate entry is attempted for insertion, mySQL will result in “#1062” error as shown below: #1062 – Duplicate entry ‘user9’ for […]