0

I'm trying to change the datatype of a column of one of my tables from TEXT to VARCHAR in my database. I use this simple query which seems correct to me:

ALTER TABLE my_database.my_table MODIFY `SalesRank` VARCHAR;

However I get the error: '' () is not valid input at this position.

What is wrong with my query? The column itself is completely empty. I'm using MYSQL Workbench.

1 Answer 1

3
ALTER TABLE my_database.my_table MODIFY `SalesRank` VARCHAR(255);

You missed size of that column. Just try above code.

Hope this will helps you

Sign up to request clarification or add additional context in comments.

1 Comment

Wow, how did I not see that. Sometimes you're just blind! :D Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.