MS SQL Server
  Home arrow MS SQL Server arrow Page 2 - Querying Databases in SQL Server 2005
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

Querying Databases in SQL Server 2005
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 39
    2006-03-22

    Table of Contents:
  • Querying Databases in SQL Server 2005
  • Creating a Query
  • The Execution Plan
  • XML Queries, a Comparison

  • 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


    Querying Databases in SQL Server 2005 - Creating a Query


    (Page 2 of 4 )

    After you start the Studio, you need to hit the New Query button, which changes the center region, which is now showing SQL Server AGENT as in Fig.2, in a new tab. This action also changes the main menu by adding the Query menu item.

    Fig.2

    Fig.3 shows how you may open up the querying tool. By clicking on the Query menu item in the Studio, you get access to all of its functionality. From this drop-down list it can be seen that all the functionalities are retained with a couple of additional ones such as SQLCMD mode, include/reset client statistics, etc.

    The vertical drop-down sub-menu items are also repeated horizontally at the top of the query editor, as can be seen in Fig.4. You may also set the database you need to query using the drop-down (partially hidden in this figure by the Query drop-down, showing only part of Northwind). The Connection menu item lets you make a connection; Disconnect disconnects all queries, or changes the connection. The Design Query in Editor... will wake up the query editor with all needed items, as we will see later. The Results To lets you show the result of a query in a text, Grid, or file, functionality that is similar to what was in SQL 2000.  The Query Option... submenu lets you configure the parameters needed by both the executed query as well as the result set returned.

    Fig. 3

    Fig.4 shows a simple query in the Query design plane. This pane is tabbed and clicking on the Summary tab; you would see summary information. This also shows the Northwind database being queried as well as two queries that can be tabbed for editing, or access. After you finish coding your query, you may test the syntax by going to Query ->Parse (or use the keyboard shortcut: CTRL+F5). Again it is assumed that developers/users will be transitioning from SQL Server 2000 to Studio and therefore they could customize their keyboard to emulate SQL Server 2000. The keyboard can be customized from the Tools menu as seen in Fig.5 by going to Tools ->Options and choosing Keyboard in the Environment node. The Standard Keyboard refers to the Studio default.

    Keyboard to emulate SQL 2000 command keys

     Fig. 4

    Fig. 5

    More MS SQL Server Articles
    More By Jayaram Krishnaswamy


       · A new major version is like entering a new territory. You start discovering new...
     

    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 1 hosted by Hostway
    Stay green...Green IT