Donate

How To Create A Database Schema In SQL Server

Source: http://msdn.microsoft.com/en-us/library/dd207005.aspx

In recent versions of sql server specifically 2005 and 2008, the database called Adventure works seems to be a good example with lots of tables to play with.
When I tried to open the database, the tables have prefix or have namespace before it.
Example: HumanResources.EmployeeAddress
In the previous example called northwind and pubs,table names were just one word.
So, to create a schema, here's how to do it:
  create schema <schema_name>  
  go  
  alter schema <schema_name>  
  transfer <dbo.yourtable>   
  go  
  -- show table  
  select * from schema_name.tablename  

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Insert Or Add Emojis In Microsoft Teams Status Message

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.