IT tutorials
 
Technology
 

SQL Server 2012 : Touring SSMS Through the Eyes of a Developer (part 1) - IntelliSense, Query Designer

10/9/2013 7:42:04 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

SQL Server Management Studio (SSMS) is the main GUI tool used by most DBAs to administer their database environments. Throughout the releases of SQL Server, this tool (known as Enterprise Manager previous to SQL Server 2005) has provided increasing amounts of functionality around database development. Although SSMS is not a database development tool, it’s important to know what kind of development-related tasks it can handle.

IntelliSense

One of the first features you notice when using the Query Editor in SSMS is IntelliSense. IntelliSense makes it very easy for the user to know what objects or statements are valid and allows for easy auto-completion of statements. For example, we have a copy of the AdventureWorks database installed on SQL Server, and IntelliSense lets us navigate and explore that database, as we’ll show next.

To use IntelliSense, simply navigate to a database—in our example, AdventureWorks—right click the node, and select, New Query. Begin typing the query shown in Figure 1. After you type the period in the statement “SELECT * FROM Sales.” a context menu will appear, as shown in Figure 1.

images

Figure 1. IntelliSense content menu in the SSMS Query Editor

Notice that the context menu lists the applicable objects that you can use to finish this part of the query. If you scroll down to CreditCard and press the Tab key, SSMS will auto-complete the input of that object name in the Query Editor window. IntelliSense is useful in many situations—when you can’t remember the object name you are looking for or the acceptable parameters of a stored procedure, to name a few.

Query Designer

In addition to IntelliSense, another richer feature can help users write queries—the Query Designer. If you have used Microsoft Access, you may recognize some similarities with the Query Designer tool that is available in both SSMS and Visual Studio. The Query Designer helps users build queries by allowing them to graphically adding tables and views together and simply click the desired columns. To launch the Query Designer, click the New Query button to get a clean Query Editor window, and select Design Query in Editor from the Query menu on the SSMS toolbar. This will launch the Query Designer, as shown in Figure 2.

images

Figure 2. Query Designer showing the Add Table dialog

Let’s add both the SalesOrderDetail and SalesOrderHeader tables to the Query Designer. Click each table’s name, and click the Add button. When you have finished adding the tables or views, click the Close button. The Query Designer knows that these two tables share a relationship and has visually marked this in the UI. From here, you can go ahead and add the search criteria information to the query by checking the desired columns and typing any “group by” or “sort” information related to the desired query. For this example, we are interested in the sum of orders for each day, so we have configured the Query Designer as shown in Figure 3.

images

Figure 3. Sales order summary query configured in Query Designer

When you click the OK button, the Query Designer yields the following T-SQL text based on the settings in Figure 3:


SELECT     SUM(Sales.SalesOrderDetail.OrderQty) AS TotalQuantity,
Sales.SalesOrderHeader.OrderDate

FROM         Sales.SalesOrderDetail INNER JOIN

                      Sales.SalesOrderHeader ON Sales.SalesOrderDetail.SalesOrderID =
Sales.SalesOrderHeader.SalesOrderID

GROUP BY Sales.SalesOrderHeader.OrderDate

ORDER BY Sales.SalesOrderHeader.OrderDate

Even through the Query Designer brought us to back to the Query Editor window, you can always go back to the designer for help with the query by highlighting the query and selecting Design Query in Editor from the context menu of the highlighted query.

 
Others
 
- Windows 7 : Kernel Mode Installation and Build - Installing a KMDF Driver
- Windows 7 : Kernel Mode Installation and Build - Building Featured Toaster
- Windows 7 : Kernel Mode Installation and Build - WDK Build Tools, Build Environment, Building a Project
- System Center Configuration Manager 2007 : Using Microsoft Management Console 3.0 (part 3)
- System Center Configuration Manager 2007 : Using Microsoft Management Console 3.0 (part 2)
- System Center Configuration Manager 2007 : Using Microsoft Management Console 3.0 (part 1)
- Administering an Exchange Server 2007 Environment : Managing Exchange Server 2007 Remotely
- Administering an Exchange Server 2007 Environment : Administrative Tools
- Administering an Exchange Server 2007 Environment : Exchange Administrator Roles in Exchange Server 2007
- Sharepoint 2010 : Enterprise Content Management - Hierarchical File Plans and Folder-Based Retention, Records Center
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us