learningcomputer.com sql server 2008 - working with databases

6
Learningcomputer.com SQL Server 2008 - Working with Databases

Upload: berenice-richardson

Post on 12-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Learningcomputer.com SQL Server 2008 - Working with Databases

Learningcomputer.com

SQL Server 2008 - Working with Databases

Page 2: Learningcomputer.com SQL Server 2008 - Working with Databases

Working with DatabasesDatabases are the building blocks of

storage in SQL Server 2008You can create a database by using one of

the following methods:SQL Server Management StudioTransact SQL

Script a database after creationTemplate Explorer

Page 3: Learningcomputer.com SQL Server 2008 - Working with Databases

SQL Server Management StudioEasiest way to create a database Industry Best Practices

Name should indicate the type of contentDatabase objects should be intuitive with no

spacesData file and log file should be on separate

physical drives. Why?For production database, the recovery option

should be set to Fulldb_owner role should be limited to a few

individuals We are going to create a database called Sales

Page 4: Learningcomputer.com SQL Server 2008 - Working with Databases

Transact SQLSyntax is CREATE DATABASEMore in SQL Server Help section We will create a database called Maint in

our Demo

Page 5: Learningcomputer.com SQL Server 2008 - Working with Databases

Other Transact SQL commandsALTER DATABASE sp_helpdbsp_dboptionDROP DATABASE

Page 6: Learningcomputer.com SQL Server 2008 - Working with Databases

Template ExplorerDemo to create another database