Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8262045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:37:42+00:00 2026-06-08T03:37:42+00:00

My sql query looks like this ALTER TABLE `exercises` ADD COLUMN `creation_dt` timestamp NOT

  • 0

My sql query looks like this

ALTER TABLE `exercises`
ADD COLUMN `creation_dt`  timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `lesson_id`,
ADD COLUMN `modification_dt`  timestamp NULL DEFAULT '' ON UPDATE CURRENT_TIMESTAMP AFTER `creation_dt`;

But getting error message

enter image description here

How can I fix this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:37:46+00:00Added an answer on June 8, 2026 at 3:37 am

    As shown in the screenshot, this is error code 1293. The reason for this error seems to be some implementation details in MySQL.

    You could get around it by using a column of type DATETIME but this does not allow setting the current time as default value. However, you can solve this in your application code or by using a trigger. I used a sample table (called datetimetest) and added the trigger like this:

    Database schema:

    CREATE TABLE `datetimetest` (
        `id` int(11) NOT NULL,
        `created` datetime NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
    
    CREATE TRIGGER trigger_SetCreated
      BEFORE INSERT ON datetimetest
      FOR EACH ROW SET NEW.created = UTC_TIMESTAMP();
    

    You can do the same for the modified field using a trigger BEFORE UPDATE or keep your solution as you now only have one TIMESTAMP column that gets set to CURRENT_TIMESTAMP ON UPDATE.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My SQL query looks like this... sekect * FROM mail_headers a LEFT JOIN mail_headers_body
I have a sql query which looks like this - NSString *createSQL = @SELECT
I have a SQL query in my ASP.net web app that looks like this:
I have a query that looks something like this: select xmlelement(rootNode, (case when XH.ID
I have a table of results that looks like this: score_id, uid, af_id, level,
I have a table code_prices that looks something like this: CODE | DATE |
Possible Duplicate: SQL Query JOIN with Table If this is the data in TestingTable1
Original SQL query is this; SELECT id,post_title,post_date FROM wp_posts where id='1' When I retrieve
I have the following string format in a Sql table column [CID]: 267 [MID]:
I am not able to understand the issue with the following SQL query. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.