Link to home
Start Free TrialLog in
Avatar of salesprod
salesprod

asked on

creating schemas

if im asked to create a database and then create a schema in the model database would it simply be
just this.

for example:
my database is called db1

and the script would be
create schema db1?

and later after creating a schema i would like to create a table called tb1 within that schema db1
would it just be Create table db1.tb1?

finally if i were to create a table very similar to
sys.database_files view

how would i determine the data types, properties constraints, primary keys, foreign keys, checks, references
Can you provide a sample
create table for the sys.database_files view?

ASKER CERTIFIED SOLUTION
Avatar of Jai S
Jai S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of salesprod
salesprod

ASKER

when i query this as select * from sys.database_files i get a view

I was wondering if you can show me how that was created the steps using the create table and the types of properties that was used.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes i understand that.
Would it be possible to create a similar architecture like that and how would that be.
thks.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hmm? im confused.

create table files where files wouuld be the sys view.. as an example
within this table, not sure what type of columns to define and properties to set.