I’m having issues with syntax error in my queries, I’m trying to alter my table.
alter table people = person
CodePudding user response:
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:
sp_rename 'table_name.old_column_name', 'new_column_name', 'COLUMN';
With your code should look like this:
sp_rename 'table_name.people', 'person', 'COLUMN';
Otherwise if you're trying to rename your table it will be like this:
sp_rename 'old_table_name', 'new_table_name';
With your code should look like this:
sp_rename 'people', 'person'
If you're trying to alter something else please check this document[1].
For MySQL or Oracle you can try the next document[2].