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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-11-06 : 07:35:50
|
| Alan writes "I have a SQL statement, that I call from VB:SELECT A, B, CFROM TableAWHERE ...UNIONSELECT X as A, Y as B, Z as CFROM TableBWHERE ...ORDER BY ATHIS WORKS FINE but I've now switched to using ADO and the MaxRecords doesn't work anymore, so I'd like to use SELECT TOPHowever, if I change the two SELECT statements above to egSELECT TOP 8 ......UNIONSELECT TOP 8 ......I get more than 8 records backIf this was a stored procedure I could use SET ROWCOUNT 8 instead of SELECT TOP 8 but I call this straight from VB to populate a recordset.Please give me some advice.Many thanksAlan" |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-11-06 : 07:38:22
|
| Make you unioned queries a derived table and then select top 8 from that ...Jay White{0} |
 |
|
|
|
|
|