Skip to content
Advertisement

How to solve syntax error with `ALTER TABLE` query?

I’m having issues with syntax error in my queries, I’m trying to alter my table.

Advertisement

Answer

Looking at your question I dind’t know what you were trying to rename if it was your table name or the column name.

For SQL Server to rename your column you can do this:

With your code should look like this:

Otherwise if you’re trying to rename your table it will be like this:

With your code should look like this:

If you’re trying to alter something else please check this document[1].

For MySQL or Oracle you can try the next document[2].

[1] https://www.w3schools.com/sql/sql_alter.asp

[2]https://www.geeksforgeeks.org/sql-alter-rename/

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement