csehz
asked on
SQL - Rename global temporary table
Dear Experts,
Could you please advise about the syntax how to rename a table by an SQL statement?
Concretely in my test that table is a global temporary table, created by:
But trying the rename for that by syntax:
An invalid parameter or option was specified for procedure 'sys.sp_rename'.
Could you please advise what is wrong with the syntax concretely in this example?
Thanks in advance
Could you please advise about the syntax how to rename a table by an SQL statement?
Concretely in my test that table is a global temporary table, created by:
CREATE TABLE
##TempTable (VendorNumber NVARCHAR(20), VendorName NVARCHAR(70));
where:SELECT * FROM dbo.##TempTable
confirms that it has been created.But trying the rename for that by syntax:
EXEC sp_rename [tempdb.dbo.##TempTable], [tempdb.dbo.##TempTableRenamed];
getting an error message that:An invalid parameter or option was specified for procedure 'sys.sp_rename'.
Could you please advise what is wrong with the syntax concretely in this example?
Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER