I want to change schema name of table
example:
FROM
I tried with this query.
But this give me error.
Error:
Cannot alter the schema 'exe', because it does not exist or you do not have permission.
What I missed or did wrong ?
Solution:
Create Schema :
ALTER Schema :
Employees
in Database. In the current table Employees
database schema name is dbo
I want to change it to exe
. How can I do it ? example:
FROM
dbo.Employees
TOexe.Employees
I tried with this query.
ALTER SCHEMA exe TRANSFER dbo.Employees
But this give me error.
Error:
Cannot alter the schema 'exe', because it does not exist or you do not have permission.
What I missed or did wrong ?
Solution:
Create Schema :
IF (NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'exe'))
BEGIN
EXEC ('CREATE SCHEMA [exe] AUTHORIZATION [dbo]')
END
ALTER SCHEMA exe
TRANSFER dbo.Employees
No comments:
Post a Comment