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:
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
Post a Comment