This topic is locked

UNION

4/23/2008 4:38:03 AM
ASPRunnerPro General questions
Z
Zauro author

Hi!
I try to add records from two tables, they are identical. But one is from a automatic system and one from a manuel system.

So the records inside is of course different, I want to take both out in one table view with the UNION ALL function.
I tried the code in SQL server managment studio and working, but when build it with ASPrunner and watch it, I get this error:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)

[Microsoft][ODBC SQL Server Driver][SQL Server]All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.

/admin/include/commonfunctions.asp, line 1470

The code is following:

select [projectID] as 'project number',

[project] as 'projects',

[extra5_ID] as 'EVM number',

[model] as 'Models',

[mhz] as 'CPU',

[hdsize] as 'HDD',

[memory] as 'mem',

[serial] as 'serials',

[comments] as 'comment',

[extra4] as 'comment 2',

[extra6] as 'comment 3'

From [dbo].[blancco]

UNION ALL

select [projectID]as 'project number',

[project] as 'projects',

[extra5_ID] as 'EVM number',

[model] as 'Models',

[mhz] as 'CPU',

[hdsize] as 'HDD',

[memory] as 'mem',

[serial] as 'serials',

[comments] as 'comment',

[extra4] as 'comment 2',

[extra6] as 'comment 3'

From [dbo].[computers]

I saw that UNION is supported in ASPrunner, so what do I do wrong?

Might it be that I have to install something on my webserver?
Regards.

Thomas

J
Jane 4/23/2008

Thomas,
unfortunately ASPRunnerPro does not support UNION ALL on the Edit SQL query tab.

As workarounf create view in teh database directly and the use this view in the ASPRunnerPro.

Z
Zauro author 4/24/2008

Ok!
Yeah, wonder why I didn't think about doing it direct in SQL Server, only bad is that it is not editable,

but that I can solve with links to the seperate tables.
Thanks alot... <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=28464&image=1&table=forumreplies' class='bbc_emoticon' alt=':lol:' />