MS SQL Server
  Home arrow MS SQL Server arrow Page 5 - SQL Server 2005 Introduction to SQL Server...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MS SQL SERVER

SQL Server 2005 Introduction to SQL Server Management Studio
By: MSDN Virtual Labs
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 18
    2006-01-12

    Table of Contents:
  • SQL Server 2005 Introduction to SQL Server Management Studio
  • Exercise 1: Exploring the Environment
  • Exercise 2: Attaching a Database
  • Exercise 3: Exploring an Existing Database
  • Exercise 4: Creating a New Database
  • Exercise 5: Setting up Database Access

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    SQL Server 2005 Introduction to SQL Server Management Studio - Exercise 4: Creating a New Database


    (Page 5 of 6 )

    Scenario
    In this exercise, you will create a new database using a SQL Server Management Studio template. You will then investigate the default properties of a new database.

               TASKS                               DETAILED STEPS

    1. Create a new database using a TSQL Template.
       
        1. Choose File | New | File.
        2. In the New File dialog box, in the Categories list, within the SQL Server Query node, select Database. In the Templates list, click create database, and then click Open. If prompted, connect to the database.

          A new query window will open, and you should see the following template:

          -- ==========================================
          -- Create database template
          --  =========================================
          IF EXISTS (
              SELECT *
                FROM    sys.databases
                WHERE name = N'<database_name, sysname, sample_database>'
          )
                DROP DATABASE <database_name, sysname, sample_database>
          GO

          CREATE DATABASE <database_name, sysname, sample_database>
          GO
        3. Select the Edit | Find and Replace | Quick Replace menu command.
        4. In the Find what textbox, enter <database_name, sysname, sample_database> (including the angle brackets).
        5. In the Replace with textbox, enter NewDB.
        6. Click Replace All. A dialog box should show 3 occurrence(s) replaced. Click OK, and then close the dialog box.
        7. Press F5 or click the Execute button on the toolbar. Click Connect if necessary.
    2. Explore your new database.
       
        1. In the Object Browser, expand Databases if necessary.
        2. Right-click on Databases and click Refresh. A NewDB folder should appear.
        3. Right-click on the NewDB folder and click Properties.
        4. Explore the properties dialog box to see what properties exist for a newly created database.

          Because the Properties window is not modal, you can open a separate Properties window for each database, making it easier to compare the two.
        5. Close the Properties window(s) when you’re done.

    More MS SQL Server Articles
    More By MSDN Virtual Labs


       · We hope you found this article from MSDN Virtual Labs to be enjoyable and...
       · Where are the projects for the SQL labs?Select C:\SQL Labs\Lab...
       · Access Virtual Labs online at microsoft.com -> Learning -> Virtual Labs on MSDN
     

    MS SQL SERVER ARTICLES

    - Completing the Introduction to Transact-SQL
    - A Brief Introduction to Transact-SQL
    - Lookups and Blocking Bad Data
    - Field Validation Rules for Blocking Bad Data
    - Using Masks to Block Bad Data
    - Blocking Bad Data
    - Using @@ROWCOUNT and TABLE Variables for Dat...
    - How to Use Variables, IF and CASE in Databas...
    - Creating Important Aspects of Notification S...
    - Working wth Variables in Database Interactio...
    - Delving Deeper into Notification Services
    - Notification Services
    - Building a Multi-table Report with SQL 2005 ...
    - A Secure Way of Building Connection Strings
    - Transferring a Database Using the SSIS Desig...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT