From: ThisBytes5 on 21 Apr 2006 18:16 I have a table I am using as a QUEUE, some of the data in the table can be quite large and as such I'd like to pull back only one record at a time. I've tried Select top 1 * from Table and Set RowCount 1 Set RowCount 1; Set RowCount 1 GO Select * from Table None of which seems to work. Is there a way to limit the data being retreived? Thanks Wayne
From: Ginny Caughey [MVP] on 23 Apr 2006 11:00 Wayne, Have you considered using a SqlCeDataReader and counting the rows as you read them so you can stop when you have the maximum you want? -- Ginny Caughey ..NET Compact Framework MVP <ThisBytes5(a)gmail.com> wrote in message news:1145657790.616837.10840(a)u72g2000cwu.googlegroups.com... >I have a table I am using as a QUEUE, some of the data in the table can > be quite large and as such I'd like to pull back only one record at a > time. I've tried > > Select top 1 * from Table > > and > > Set RowCount 1 Set RowCount 1; Set RowCount 1 GO > Select * from Table > > None of which seems to work. Is there a way to limit the data being > retreived? > > Thanks > Wayne >
From: ThisBytes5 on 23 Apr 2006 14:03 This is actually what I am doing. I had tow threads running, one writing one reading, they were locking up from time to time and I thought it may have been a database locking issue. So I wanted to load the records for reading in a dataset, but not all of them. Turns out it was a threading issue and I got it resolved. I'd still like to know if there is a way to limit the rows returned though. Thanks Wayne
From: Ginny Caughey [MVP] on 23 Apr 2006 16:04 Wayne, You're doing it the best way already as far as I know. -- Ginny Caughey ..NET Compact Framework MVP <ThisBytes5(a)gmail.com> wrote in message news:1145815395.363000.210300(a)t31g2000cwb.googlegroups.com... > This is actually what I am doing. I had tow threads running, one > writing one reading, they were locking up from time to time and I > thought it may have been a database locking issue. So I wanted to load > the records for reading in a dataset, but not all of them. > > Turns out it was a threading issue and I got it resolved. I'd still > like to know if there is a way to limit the rows returned though. > > Thanks > Wayne >
From: Darren Shaffer on 26 Apr 2006 18:46 there are a limited set of functions in SQL Mobile (COUNT, MIN, MAX) and no support for TOP. your best bet is to manage the range of records either with the SqlCeResultSet as Ginny suggested or think about using Seek with SetRange and TableDirect mode. -- Darren Shaffer ..NET Compact Framework MVP Principal Architect Connected Innovation www.connectedinnovation.com <ThisBytes5(a)gmail.com> wrote in message news:1145657790.616837.10840(a)u72g2000cwu.googlegroups.com... >I have a table I am using as a QUEUE, some of the data in the table can > be quite large and as such I'd like to pull back only one record at a > time. I've tried > > Select top 1 * from Table > > and > > Set RowCount 1 Set RowCount 1; Set RowCount 1 GO > Select * from Table > > None of which seems to work. Is there a way to limit the data being > retreived? > > Thanks > Wayne >
|
Pages: 1 Prev: lineGetGeneralInfo Next: Visual Studio 2005 + Win CE .NET 4.2 = false? |