Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Unable to save UNION query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-02-09 : 09:39:06
ash writes "I have a union query that will execute when pressing run in design mode but will not save. This is the query:

SELECT Range, ons_name, MARMAY05, JUNAUG05, SEPNOV05
FROM dbo.view_pub_emp_PREP_overall_allwards
UNION
SELECT Range, ons_name, MARMAY05, JUNAUG05, SEPNOV05
FROM dbo.view_pub_emp_PREP_overall_nonworstwards
UNION
SELECT Range, ons_name, MARMAY05, JUNAUG05, SEPNOV05
FROM dbo.view_pub_emp_PREP_overall_worstwards

When executed (in design mode) it returns the correct result (after warning me that it cannot display a union query design in the diagram pane) but when I try to save it I get "View definition includes no output columns or no items in the FROM clause".

Now the annoying thing about this is that I managed to save one view with the above syntax that works fine but I can't even copy and paste the sql into a new view and then save the new one without receiving the error message and being unable to save.

Using Microsoft SQL Enterprise Manager, Version: 8.0

Any advice greatly appreciated :o)

ash jeffries"

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2006-02-09 : 10:08:04
Do your development in Query Analyzer, not the GUI designer. Time to take off the training wheels...
Go to Top of Page
   

- Advertisement -