Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a table that have the following table structure

  [ID] [bigint] IDENTITY(1,1) NOT NULL,
  [ASATID]  AS ('ASAT'+right('00000000000000000000'
  +CONVERT([varchar](19),[ID],0),(20))) PERSISTED NOT NULL,
  [Created] [nvarchar](8) NOT NULL DEFAULT (CONVERT([varchar],dateadd(year,

When I used the MySQL Migration Wizard to convert the above Microsoft database table structure, I got errors that both datatype for my fields ASATID and Created was not supported (in MySQL).

What are the recommended ways to proceed such data type differences when performing a database migration from SQL Server to MySQL?

share|improve this question

This answer will apply to your question : Insert Value based on One Column based on Value on another Column

AFAIK, and based on the link posted, you cannot create a computed column in MySQL. You should either:

  • Do the calculation outside of the database, when inserting OR
  • Create a trigger on the table to populate the value for you OR
  • Create a view to represent the data in the way you want.
share|improve this answer
MariaDB has computed columns. That might be another alternative. – ypercubeᵀᴹ Mar 19 '14 at 3:47
Considering the computed column just seems to be for formatting, I'd go with a view. – David Crowell Mar 19 '14 at 14:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.