Export (0) Print
Expand All

Create UNION Queries (Visual Database Tools)


The UNION keyword enables you to include the results of two SELECT statements in one resulting table. All rows returned from either SELECT statement are combined into the result of the UNION expression. For examples, see SELECT Examples (Transact-SQL).


The Diagram pane can only display one SELECT clause. Therefore, when you are working with a UNION query, Query Designer hides the Table Operations pane.

To create a Merged SELECT query

  1. Open a query or create a new one.

  2. In the SQL pane, type a valid UNION expression.

    The following example is a valid UNION expression.

    SELECT ProductModelID, Name
    FROM Production.ProductModel
    SELECT ProductModelID, Name 
    FROM dbo.Gloves;
  3. On the Query Designer menu, click Execute SQL to run the query.

    Your UNION query is now formatted by Query Designer.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft