The SQL query that I have used is :
SQL
ALTER TABLE oldtable RENAME TO newtable;
But, it gives me an error.
To change a table name with a different schema:
Example: Change dbo.MyTable1 to wrk.MyTable2
EXEC SP_RENAME 'dbo.MyTable1', 'MyTable2' ALTER SCHEMA wrk TRANSFER dbo.MyTable2