Re: Management Studio & Views containing unions



Stephan Steiner (stephan.steiner@xxxxxxxxxxxxx) writes:
I'm having a major beef with Management Studio Express when it comes to
editing Views that contain a UNION statement. For starters, it can't
display the View, which I guess is OK, the old tool couldn't do that
either. But, the syntax verification doesn't work either.. I get an
"Incorrect Syntax near UNION" error each time. But, if the syntax is
valid, saving is no problem.. and neither is a select on the view.

Why does MSE choke on a union even if the query is valid? I can understand
the issues regarding displaying a query that contains unions, but if valid
syntax is used, why can a query not be syntax checked?

Rather than selecting Modify from the context menu, continue down to
Script View As to get the view in a plain query window instead of the
crappy Query Designer.


--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: how to get unique resultset
    ... > If you have more than one row in tblMain that meets the criteria then ... > query results using the query I gave you. ... > more associated rows exist in the subquery, and display that row once ... > tblKeyphrases in the syntax I gave you, but that is exactly the point. ...
    (microsoft.public.access.queries)
  • Re: Access Query
    ... UNION query to put the ... Because of the syntax, ... >The left and right square brackets are required, ...
    (microsoft.public.access.formscoding)
  • Re: displaying multiple dates in a table
    ... If you cannot do that then you would need to build a fairly complex query ... that as the source of your birthday query. ... Sample Union query - ... display per month... ...
    (microsoft.public.access.queries)
  • RE: Adding to a combo box list that is based on a table
    ... the list of fields returned by the query. ... how would I include the UNION statement? ... several fields to display, but the bound column is column 2, the record ID. ...
    (microsoft.public.access.formscoding)
  • Management Studio & Views containing unions
    ... editing Views that contain a UNION statement. ... For starters, it can't display ... I get an "Incorrect Syntax ... Why does MSE choke on a union even if the query is valid? ...
    (microsoft.public.sqlserver.tools)