Forum Discussion
How are schemas used and defined in Azure and wih Azure Data Studio?
I had thought that a database schema was the name of the structure on which tables are interconnected by primary keys and foreign keys. But in the tool, Azure Data Studio, the user is asked to select from a pre-defined set of schemas when creating a table. What is more is that when setting up or createing a database through Azure, we are given the opportuniityh to use a sample database and this is where "SalesLT" comes from and so there must be some place where we can define a schema with Azure Data Studio. Where would that be? It was generated when deciding to use a demo sample database. So there must be some way, using SQL code or otherwise, to generate a schema.
1 Reply
Below the suggestion on how to view or create schemas in Azure Data Studio:
1. View Existing Schemas:
-
- Connect to your database.
- Expand the database in the Object Explorer.
- Navigate to Schemas under Security.
2. Create a Schema via SQL:
CREATE SCHEMA Inventory AUTHORIZATION dbo;
3. Assign Tables to a Schema:
CREATE TABLE Inventory.Products ( ProductID INT PRIMARY KEY, Name NVARCHAR(100) );
-