Good morning,
I have a SQL Server Database I am working on and only have SQL Developer to work on it and I am coming up with lots of issues to getting some basic stuff to work.
All I am really trying to do is rename a query but it simply will not work, here is what I have tried.
sp_rename 'Contact2', 'Contact4' - which gives me a command unknown error
EXEC sp_rename 'Contact3, 'Contact4' - Incorrect syntax near the keyword 'BEGIN'
ALTER TABLE CONTACT3 RENAME TO CONTACT4 - Incorrect syntax near the keyword 'TO'
ALTER TABLE RENAME CONTACT3 TO CONTACT4 - Incorrect syntax near '.'.
So I figured if I couldn't change the name I could recreate the table so tried
CREATE TABLE CONTACT4 AS (SELECT * FROM CONTACT2); - Incorrect syntax near the keyword 'AS'.
I have tried several other variations but can not remember them all now.
Can anyone please tell me how to rename an SQL Server Table using SQL Developer?
Thanks
I have a SQL Server Database I am working on and only have SQL Developer to work on it and I am coming up with lots of issues to getting some basic stuff to work.
All I am really trying to do is rename a query but it simply will not work, here is what I have tried.
sp_rename 'Contact2', 'Contact4' - which gives me a command unknown error
EXEC sp_rename 'Contact3, 'Contact4' - Incorrect syntax near the keyword 'BEGIN'
ALTER TABLE CONTACT3 RENAME TO CONTACT4 - Incorrect syntax near the keyword 'TO'
ALTER TABLE RENAME CONTACT3 TO CONTACT4 - Incorrect syntax near '.'.
So I figured if I couldn't change the name I could recreate the table so tried
CREATE TABLE CONTACT4 AS (SELECT * FROM CONTACT2); - Incorrect syntax near the keyword 'AS'.
I have tried several other variations but can not remember them all now.
Can anyone please tell me how to rename an SQL Server Table using SQL Developer?
Thanks
Comment