Showing posts with label setting. Show all posts
Showing posts with label setting. Show all posts

Friday, March 30, 2012

how to control the number of row?

i want to contorl the output number of row with a certain number when select data from table that not exceed the number with my setting.

For example,if the result is exceed the 500 rows, then i just require 200 rows, that what is the command of this function?

Thanks for any help...

You can try something like:

SELECT top 500
...
from TableName

another more archaic form is to execute

SET ROWCOUNT 500

However, this will also limit the number of records update or inserted, deleted etc. Turn off the limit by:

SET ROWCOUNT 0

The TOP option is in general the better option. Look the two up in books online.

sql

Monday, March 19, 2012

how to configure SQL Server 7.x memory

Hi,
I am curious what the steps are to follow to configure the
SQL server memory settings please?
How do you tell what the current setting is?
We have 500 MB of RAM and an additional 500 MB of RAM was
added. How do you give more memory to SQL server?
In previous posts that I have scanned for memory in here,
what is awe?
Thanks,
Cynthia
(only temporarily assisting to optimize the SQL Server, as
I am not a SQL Server DBA..any help is appreciated).Until you reach 4GB of physical RAM, PAE and AWE are unnecessary settings.
Normally, SQL will adjust itself to take all memory and leave 8-10MB free.
This is good if the server is dedicated to SQL. If other applications run
on SQL, you may want to limit how much memory SQL uses. That can be a trial
and error process since the memory consumption depends on the behavior of
other applications.
So, if it is a dedicated SQL server, leave it alone. Once the OS sees the
memory, SQL will take advantage of it.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Cynthia" <anonymous@.discussions.microsoft.com> wrote in message
news:940601c40525$32a37b00$a101280a@.phx.gbl...
> Hi,
> I am curious what the steps are to follow to configure the
> SQL server memory settings please?
> How do you tell what the current setting is?
> We have 500 MB of RAM and an additional 500 MB of RAM was
> added. How do you give more memory to SQL server?
> In previous posts that I have scanned for memory in here,
> what is awe?
> Thanks,
> Cynthia
> (only temporarily assisting to optimize the SQL Server, as
> I am not a SQL Server DBA..any help is appreciated).
>|||Geoff,
Thank you for the quick response. Does this mean you do
not have to run sp_configure "Memory" (similar command as
in sybase) to fix a set amt of memory if it is less than 4
gb in size?
Thanks
Cynthia
>--Original Message--
>Until you reach 4GB of physical RAM, PAE and AWE are
unnecessary settings.
>Normally, SQL will adjust itself to take all memory and
leave 8-10MB free.
>This is good if the server is dedicated to SQL. If other
applications run
>on SQL, you may want to limit how much memory SQL uses.
That can be a trial
>and error process since the memory consumption depends on
the behavior of
>other applications.
>So, if it is a dedicated SQL server, leave it alone.
Once the OS sees the
>memory, SQL will take advantage of it.
>--
>Geoff N. Hiten
>Microsoft SQL Server MVP
>Senior Database Administrator
>Careerbuilder.com
>I support the Professional Association for SQL Server
>www.sqlpass.org
>"Cynthia" <anonymous@.discussions.microsoft.com> wrote in
message
>news:940601c40525$32a37b00$a101280a@.phx.gbl...
the
was
here,
as
>
>.
>|||Actually, there are commands to set min and max server memory. These are
for two circumstances, 1) there is more than 4GB of physical RAM in the box.
2) If you want/need to manage memory yourself. If neither apply and you
want SQL to take care of memory management, just leave it alone.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
<anonymous@.discussions.microsoft.com> wrote in message
news:8df701c40528$402761d0$a301280a@.phx.gbl...
> Geoff,
> Thank you for the quick response. Does this mean you do
> not have to run sp_configure "Memory" (similar command as
> in sybase) to fix a set amt of memory if it is less than 4
> gb in size?
> Thanks
> Cynthia
> unnecessary settings.
> leave 8-10MB free.
> applications run
> That can be a trial
> the behavior of
> Once the OS sees the
> message
> the
> was
> here,
> as