Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

SQL Server keeps assigning dbo Schema, even though I specify a different schema

$
0
0

I'm using T-SQL to Create a table.

No matter what I do, the table gets created as dbo.TableName.

When I use this script

USE CBirtDev
go

CREATE TABLE [Inventory.PurchaseOrigin]
    (
    PurchaseOriginID        tinyint        NOT NULL    IDENTITY ( 1,1 ),
    PurchaseOrigin            varchar(30)    NOT NULL
    CONSTRAINT [PKPurchaseOrigin_PurchaseOriginID] PRIMARY KEY CLUSTERED ([PurchaseOriginID] ASC),
    CONSTRAINT [AKPurchaseOrigin_PurchaseOrigin] UNIQUE ([PurchaseOrigin] ASC)
    )
go

It creates a table with the following name: dbo.Inventory.PurchaseOrigin, instead of Inventory.PurchaseOrigin.

Why is it ignoring my Inventory Schema? If I incorporate the Database name into the script like

CREATE TABLE CBirtDev.Inventory.PurchaseOrigin it gives me dbo.CBirtDev.Inventory.PurchaseOrigin.

Totally frustrated...please help.


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>