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 |
|
johnstern
Yak Posting Veteran
67 Posts |
Posted - 2007-06-14 : 10:51:59
|
| I am contemplating two ways to pass data from the sqlserver to clientfirst I have a single record set, the information for showpic, showaddress, name is repeated then for each entry the user made in the forummessageid | message | userID | name | address | | showpic | showaddress | showlocation1 | my test1 | 1004 | peter | peter@mio.com | 1 | 1 | 12 | my test3 | 1003 | john | john@mio.com | 1 | 1 | 13 | my test3 | 1003 | john | john@mio.com | 1 | 1 | 14 | my test6 | 1005 | lucas | lucas@mio.com | 0 | 0 | 05 | my test6 | 1003 | john | john@mio.com | 1 | 1 | 16 | my test6 | 1003 | john | john@mio.com | 1 | 1 | 1my question is, would it be better to keep these info as two separated recordsets and combine/process them in the client side, is it worth doing it ?like this:usersuserID | name | address | | showpic | showaddress | showlocation1004 | peter | peter@mio.com | 1 | 1 | 11003 | john | john@mio.com | 1 | 1 | 11005 | lucas | lucas@mio.com | 0 | 0 | 0messagesmessageid | message | userID 1 | my test1 | 1004 2 | my test3 | 10033 | my test3 | 1003 4 | my test6 | 1005 5 | my test6 | 10036 | my test6 | 1003 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-06-14 : 11:03:28
|
| I think it would be better to combine them client-side. They need to be Order By something common to both resultsets, and you need to ensure that both ARE Ordered By those column(s) - otherwise you'll never combine them client side!!When the recordsets get large-ish pumping all the duplicate data [using the single recordset solution] is going to really bog things downYou may find that you cannot process both resultsets concurrently via a single database connection (and you may only find this with large recordsets!) so something to watch out for in debugging. You may want to pull all the data from the first resultset into an "array" of some sort in your application, and then issue the query for the second resultset. Or you may be using a SProc that returns two resultsets - in which case you'll have to store the first into an Array before you can get to the second!Kristen |
 |
|
|
|
|
|