How do I create a SQL table under a different schema?
Solution 1:
- Right-click on the tables node and choose
New Table...
- With the table designer open, open the properties window (view -> Properties Window).
- You can change the schema that the table will be made in by choosing a schema in the properties window.
Solution 2:
Try running CREATE TABLE [schemaname].[tableName]; GO;
This assumes the schemaname exists in your database. Please use CREATE SCHEMA [schemaname]
if you need to create a schema as well.
EDIT: updated to note SQL Server 11.03 requiring this be the only statement in the batch.