Showing posts with label request. Show all posts
Showing posts with label request. Show all posts

Friday, March 9, 2012

How to return a set of Data ?

Hello,
I have to make queries on a very big database, bon only part by part.
For example : I would like to use a SELECT request and get only the rows
1000 to 1999.
With the TOP keywork, I can get the 10 first rows. But what is the command
to retrieve the rows between tho numbers ?I would use a generated IDENTITY column in the result set, and then filter
on the IDENTITY value.
Martin
"Florent CORNEILLE" <FlorentCORNEILLE@.discussions.microsoft.com> wrote in
message news:DE105ECC-7FD0-44FA-97C8-AB495BBC7601@.microsoft.com...
> Hello,
> I have to make queries on a very big database, bon only part by part.
> For example : I would like to use a SELECT request and get only the rows
> 1000 to 1999.
> With the TOP keywork, I can get the 10 first rows. But what is the command
> to retrieve the rows between tho numbers ?
>|||-- Try:
SELECT *
FROM <@.your_table, SYSNAME, >
WHERE <@.your_field, SYSNAME, > Between 1000 And 1999
-- This query is formatted as a template, so from Query Analyser, press
Ctrl+Shift+M and fill in the parameters.
-- Lookup "Using Templates in SQL Query Analyzer" in BOL
-- Damien
"Florent CORNEILLE" wrote:

> Hello,
> I have to make queries on a very big database, bon only part by part.
> For example : I would like to use a SELECT request and get only the rows
> 1000 to 1999.
> With the TOP keywork, I can get the 10 first rows. But what is the command
> to retrieve the rows between tho numbers ?
>

Wednesday, March 7, 2012

How to retrieve the GUID value of a SQL NewID() identity column after an insert ?

Hello,

In my table, i've a GUID column type. I insert a new record with NewID() function in Sql request.

Is it possible to retreive the GUID column of this new record (without requerying the table) ?

I'm using EVC, Sql Mobile 3.0 and OLE DB interface.

Thanks in advance.

no, you have to turn around and requery the database. another option if you are using CF2 is to create the GUID in your mobile app code and use it in your INSERT statement instead of NewID(). Then you know what it is without the extra database roundtrip.

-Darren

How to retrieve the GUID value of a SQL NewID() identity column after an insert ?

Hello,

In my table, i've a GUID column type. I insert a new record with NewID() function in Sql request.

Is it possible to retreive the GUID column of this new record (without requerying the table) ?

I'm using EVC, Sql Mobile 3.0 and OLE DB interface.

Thanks in advance.

no, you have to turn around and requery the database. another option if you are using CF2 is to create the GUID in your mobile app code and use it in your INSERT statement instead of NewID(). Then you know what it is without the extra database roundtrip.

-Darren