I am looking to make a "schema only" (no data) copy of a database on my local server. I used Tasks -> Generate scripts to script the tables from my existing database and then after creating the new database opened a query window and pasted the copied scripts in.
When I ran the scripts I received the following error ...
Msg 2760, Level 16, State 1, Line 1
The specified schema name "abc" either does not exist or you do not have permission to use it.
Msg 2760, Level 16, State 1, Line 1
The specified schema name "xyz" either does not exist or you do not have permission to use it.
Msg 2760, Level 16, State 1, Line 1
Now some of the tables I selected to be scripted do make use of different schemas (abc
& xyz
) yet I am unsure as to why they cannot be scripted. Looking at my login I am mapped to the db_owner
role which I would think would give me the appropriate permissions to create the schema. I am using SQL Server 2012.
CREATE SCHEMA
definitions? If not, and the destination database is empty, how isabc
going to already exist there?