Home All Groups Group Topic Archive Search About


Author
3 Dec 2008 12:29 AM
Eric
Hi All,

If I want to enable a user to extract up to 200 rows per a request, how that
can be done?
Is it possible to control?

Thanks,

Eric

Author
3 Dec 2008 12:41 AM
Jonathan Kehayias
You can do server-side paging of the data following the example in this
article:

http://www.sqlteam.com/article/server-side-paging-using-sql-server-2005

Not sure if that is exactly what you are after or not.  Can you provide a
little more information on what exactly you are after if it doesn't answer
the question?

--
Jonathan Kehayias
SQL Server MVP
http://jmkehayias.blogspot.com
http://www.sqlclr.net

Show quoteHide quote
"Eric" <Eric***@Hotmail.com> wrote in message
news:ecb8D5NVJHA.2468@TK2MSFTNGP02.phx.gbl...
> Hi All,
>
> If I want to enable a user to extract up to 200 rows per a request, how
> that can be done?
> Is it possible to control?
>
> Thanks,
>
> Eric
>
Are all your drivers up to date? click for free checkup

Author
3 Dec 2008 4:28 PM
Eric
Hi There,

My idea is how to prevent that someone that may work on my sql server 2005
will not attempt to extract more then 200 record. The person may try to
extract millions of records so I am trying to find out how to prevent that?
That person  will work with me remotely and I need to setup an account for
him. I hope that was enough details.

Thanks,

Eric


Show quoteHide quote
"Jonathan Kehayias" <jmkehayias.nospam@nospam.gmail.com> wrote in message
news:%23iqfO$NVJHA.4900@TK2MSFTNGP05.phx.gbl...
> You can do server-side paging of the data following the example in this
> article:
>
> http://www.sqlteam.com/article/server-side-paging-using-sql-server-2005
>
> Not sure if that is exactly what you are after or not.  Can you provide a
> little more information on what exactly you are after if it doesn't answer
> the question?
>
> --
> Jonathan Kehayias
> SQL Server MVP
> http://jmkehayias.blogspot.com
> http://www.sqlclr.net
>
> "Eric" <Eric***@Hotmail.com> wrote in message
> news:ecb8D5NVJHA.2468@TK2MSFTNGP02.phx.gbl...
>> Hi All,
>>
>> If I want to enable a user to extract up to 200 rows per a request, how
>> that can be done?
>> Is it possible to control?
>>
>> Thanks,
>>
>> Eric
>>
>
>
Author
3 Dec 2008 7:05 PM
Jonathan Kehayias
You can't do that at the user or login level.  It would be based on the
query code that they submit to the server more or less.

--
Jonathan Kehayias
SQL Server MVP
http://jmkehayias.blogspot.com
http://www.sqlclr.net

Show quoteHide quote
"Eric" <Eric***@Hotmail.com> wrote in message
news:%23uMUARWVJHA.3688@TK2MSFTNGP02.phx.gbl...
> Hi There,
>
> My idea is how to prevent that someone that may work on my sql server 2005
> will not attempt to extract more then 200 record. The person may try to
> extract millions of records so I am trying to find out how to prevent
> that? That person  will work with me remotely and I need to setup an
> account for him. I hope that was enough details.
>
> Thanks,
>
> Eric
>
>
> "Jonathan Kehayias" <jmkehayias.nospam@nospam.gmail.com> wrote in message
> news:%23iqfO$NVJHA.4900@TK2MSFTNGP05.phx.gbl...
>> You can do server-side paging of the data following the example in this
>> article:
>>
>> http://www.sqlteam.com/article/server-side-paging-using-sql-server-2005
>>
>> Not sure if that is exactly what you are after or not.  Can you provide a
>> little more information on what exactly you are after if it doesn't
>> answer the question?
>>
>> --
>> Jonathan Kehayias
>> SQL Server MVP
>> http://jmkehayias.blogspot.com
>> http://www.sqlclr.net
>>
>> "Eric" <Eric***@Hotmail.com> wrote in message
>> news:ecb8D5NVJHA.2468@TK2MSFTNGP02.phx.gbl...
>>> Hi All,
>>>
>>> If I want to enable a user to extract up to 200 rows per a request, how
>>> that can be done?
>>> Is it possible to control?
>>>
>>> Thanks,
>>>
>>> Eric
>>>
>>
>>
>
>
Author
3 Dec 2008 12:52 AM
Plamen Ratchev
You can use the TOP option to limit the result set:

SELECT TOP 200 <columns>
FROM Table
ORDER BY ...

--
Plamen Ratchev
http://www.SQLStudio.com
Author
3 Dec 2008 4:32 AM
Jonathan Kehayias
TOP will always return the first 200 rows, it won't allow retrieval of
subsequent sets of 200 from the database.  If the first 200 is all that is
needed TOP would work, but if you need paging, it won't.

--
Jonathan Kehayias
SQL Server MVP
http://jmkehayias.blogspot.com
http://www.sqlclr.net


Show quoteHide quote
"Plamen Ratchev" <Pla***@SQLStudio.com> wrote in message
news:8ZOdnYrnfO3PRajUnZ2dnUVZ_qfinZ2d@speakeasy.net...
> You can use the TOP option to limit the result set:
>
> SELECT TOP 200 <columns>
> FROM Table
> ORDER BY ...
>
> --
> Plamen Ratchev
> http://www.SQLStudio.com
Author
3 Dec 2008 4:54 AM
Plamen Ratchev
The question was how to extract 200 rows per user request, it did not
mention paging at all. You could build a paging solution using TOP.

--
Plamen Ratchev
http://www.SQLStudio.com
Author
3 Dec 2008 5:53 AM
Jonathan Kehayias
In my original post I made the comment that I wasn't sure if paging was what
they were after or not.  My interpretation of the question being asked might
be different than yours or someone elses.

I also didn't say that you absolutely couldn't build a paging solution with
TOP, I said doing a simple TOP 200 won't allow paging.  TOP for paging would
be one of the more expensive ways of doing paging in SQL Server.  The cost
to sort for TOP for paging can easily be more than using a CTE or a Table
Variable with an identity RowID column to control the paging sets.

--
Jonathan Kehayias
SQL Server MVP
http://jmkehayias.blogspot.com
http://www.sqlclr.net


Show quoteHide quote
"Plamen Ratchev" <Pla***@SQLStudio.com> wrote in message
news:8ZOdnYTnfO2DjKvUnZ2dnUVZ_qfinZ2d@speakeasy.net...
> The question was how to extract 200 rows per user request, it did not
> mention paging at all. You could build a paging solution using TOP.
>
> --
> Plamen Ratchev
> http://www.SQLStudio.com

Bookmark and Share