The SQL query that I have used is :
SQL
ALTER TABLE oldtable RENAME TO newtable;
But, it gives me an error.
To rename a table in SQL Server, use the sp_rename command:
exec sp_rename 'schema.old_table_name', 'new_table_name'