Hi
I have a problem on microsoft sql server 2000.
I need to limit the amount of resources(eg cpu, mem..) a query uses
Is there a way to do this in SQL server 2000
Thks in advance
:eek:for the server u can limit the max mem usage. u can also limit the max query time for the server as a whole or for a connection. check
SET QUERY_GOVERNOR_COST_LIMIT at BOL.
Showing posts with label amount. Show all posts
Showing posts with label amount. Show all posts
Monday, March 12, 2012
Limiting the amount of rows
I want to list a particular attribute value and the number of times it occurs
in the database ie
Attribute value 1 6
Attribute value 2 5
Attribute value 3 5
Attribute value 4 4
Attribute value 5 4
Attribute value 6 3
Attribute value 7 3
Attribute value 8 3
Attribute value 9 3
Attribute value 10 2
Attribute value 11 2
Attribute value 12 1
Attribute value 13 1
However I want the result set to list the top 10 records. This could be
done using the top 10 function. However as you can see Attribute value
10 and 11 both have the total of 2 and are therefore equilvalent. So I
really want the top 11 returned in this case. If Attribute value 12
had been 2 then I would have wanted the top 12 etc
How can I do this?
MTKIRWAN wrote:
> I want to list a particular attribute value and the number of times
> it occurs in the database ie
> Attribute value 1 6
> Attribute value 2 5
> Attribute value 3 5
> Attribute value 4 4
> Attribute value 5 4
> Attribute value 6 3
> Attribute value 7 3
> Attribute value 8 3
> Attribute value 9 3
> Attribute value 10 2
> Attribute value 11 2
> Attribute value 12 1
> Attribute value 13 1
> However I want the result set to list the top 10 records. This could
> be done using the top 10 function. However as you can see Attribute
> value 10 and 11 both have the total of 2 and are therefore
> equilvalent. So I really want the top 11 returned in this case. If
> Attribute value 12
> had been 2 then I would have wanted the top 12 etc
> How can I do this?
Try something like this:
In this example, I'm looking for the TOP 4. There are 6 groups. If you
run a GROUP BY with COUNT in DESC order on the COUNT, you'll see we have
a matching count on 4 and 5, so what we really want is the first five
groups.
What I did was use an IN query to pull in just the raw totals for the
highest 4 rows and then use those results in the HAVING clause. The main
query does not use a TOP clause because we are limited by the HAVING.
create table #test (Attr varchar(10))
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr2')
insert into #test values ('Attr2')
insert into #test values ('Attr2')
insert into #test values ('Attr3')
insert into #test values ('Attr3')
insert into #test values ('Attr3')
insert into #test values ('Attr4')
insert into #test values ('Attr4')
insert into #test values ('Attr5')
insert into #test values ('Attr5')
select Attr, COUNT(*) as 'Count'
from #test
Group By Attr
Having COUNT(*) IN (
select TOP 4 COUNT(*) as 'Count'
from #test
Group By Attr
Order By 1 Desc)
Order By 2 Desc
David Gugick
Imceda Software
www.imceda.com
|||On Wed, 22 Sep 2004 18:59:03 -0700, MTKIRWAN wrote:
> However I want the result set to list the top 10 records. This could be
> done using the top 10 function. However as you can see Attribute value
>10 and 11 both have the total of 2 and are therefore equilvalent. So I
> really want the top 11 returned in this case. If Attribute value 12
>had been 2 then I would have wanted the top 12 etc
> How can I do this?
TOP 10 WITH TIES
?
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
|||Hugo Kornelis wrote:
> On Wed, 22 Sep 2004 18:59:03 -0700, MTKIRWAN wrote:
>
> TOP 10 WITH TIES
> ?
> Best, Hugo
I guess you learn something every day. Never knew.
David Gugick
Imceda Software
www.imceda.com
in the database ie
Attribute value 1 6
Attribute value 2 5
Attribute value 3 5
Attribute value 4 4
Attribute value 5 4
Attribute value 6 3
Attribute value 7 3
Attribute value 8 3
Attribute value 9 3
Attribute value 10 2
Attribute value 11 2
Attribute value 12 1
Attribute value 13 1
However I want the result set to list the top 10 records. This could be
done using the top 10 function. However as you can see Attribute value
10 and 11 both have the total of 2 and are therefore equilvalent. So I
really want the top 11 returned in this case. If Attribute value 12
had been 2 then I would have wanted the top 12 etc
How can I do this?
MTKIRWAN wrote:
> I want to list a particular attribute value and the number of times
> it occurs in the database ie
> Attribute value 1 6
> Attribute value 2 5
> Attribute value 3 5
> Attribute value 4 4
> Attribute value 5 4
> Attribute value 6 3
> Attribute value 7 3
> Attribute value 8 3
> Attribute value 9 3
> Attribute value 10 2
> Attribute value 11 2
> Attribute value 12 1
> Attribute value 13 1
> However I want the result set to list the top 10 records. This could
> be done using the top 10 function. However as you can see Attribute
> value 10 and 11 both have the total of 2 and are therefore
> equilvalent. So I really want the top 11 returned in this case. If
> Attribute value 12
> had been 2 then I would have wanted the top 12 etc
> How can I do this?
Try something like this:
In this example, I'm looking for the TOP 4. There are 6 groups. If you
run a GROUP BY with COUNT in DESC order on the COUNT, you'll see we have
a matching count on 4 and 5, so what we really want is the first five
groups.
What I did was use an IN query to pull in just the raw totals for the
highest 4 rows and then use those results in the HAVING clause. The main
query does not use a TOP clause because we are limited by the HAVING.
create table #test (Attr varchar(10))
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr2')
insert into #test values ('Attr2')
insert into #test values ('Attr2')
insert into #test values ('Attr3')
insert into #test values ('Attr3')
insert into #test values ('Attr3')
insert into #test values ('Attr4')
insert into #test values ('Attr4')
insert into #test values ('Attr5')
insert into #test values ('Attr5')
select Attr, COUNT(*) as 'Count'
from #test
Group By Attr
Having COUNT(*) IN (
select TOP 4 COUNT(*) as 'Count'
from #test
Group By Attr
Order By 1 Desc)
Order By 2 Desc
David Gugick
Imceda Software
www.imceda.com
|||On Wed, 22 Sep 2004 18:59:03 -0700, MTKIRWAN wrote:
> However I want the result set to list the top 10 records. This could be
> done using the top 10 function. However as you can see Attribute value
>10 and 11 both have the total of 2 and are therefore equilvalent. So I
> really want the top 11 returned in this case. If Attribute value 12
>had been 2 then I would have wanted the top 12 etc
> How can I do this?
TOP 10 WITH TIES
?
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
|||Hugo Kornelis wrote:
> On Wed, 22 Sep 2004 18:59:03 -0700, MTKIRWAN wrote:
>
> TOP 10 WITH TIES
> ?
> Best, Hugo
I guess you learn something every day. Never knew.
David Gugick
Imceda Software
www.imceda.com
Labels:
5attribute,
6attribute,
amount,
attribute,
database,
ieattribute,
limiting,
microsoft,
mysql,
number,
occursin,
oracle,
particular,
rows,
server,
sql,
value
Limiting the amount of rows
I want to list a particular attribute value and the number of times it occurs
in the database ie
Attribute value 1 6
Attribute value 2 5
Attribute value 3 5
Attribute value 4 4
Attribute value 5 4
Attribute value 6 3
Attribute value 7 3
Attribute value 8 3
Attribute value 9 3
Attribute value 10 2
Attribute value 11 2
Attribute value 12 1
Attribute value 13 1
However I want the result set to list the top 10 records. This could be
done using the top 10 function. However as you can see Attribute value
10 and 11 both have the total of 2 and are therefore equilvalent. So I
really want the top 11 returned in this case. If Attribute value 12
had been 2 then I would have wanted the top 12 etc
How can I do this?MTKIRWAN wrote:
> I want to list a particular attribute value and the number of times
> it occurs in the database ie
> Attribute value 1 6
> Attribute value 2 5
> Attribute value 3 5
> Attribute value 4 4
> Attribute value 5 4
> Attribute value 6 3
> Attribute value 7 3
> Attribute value 8 3
> Attribute value 9 3
> Attribute value 10 2
> Attribute value 11 2
> Attribute value 12 1
> Attribute value 13 1
> However I want the result set to list the top 10 records. This could
> be done using the top 10 function. However as you can see Attribute
> value 10 and 11 both have the total of 2 and are therefore
> equilvalent. So I really want the top 11 returned in this case. If
> Attribute value 12
> had been 2 then I would have wanted the top 12 etc
> How can I do this?
Try something like this:
In this example, I'm looking for the TOP 4. There are 6 groups. If you
run a GROUP BY with COUNT in DESC order on the COUNT, you'll see we have
a matching count on 4 and 5, so what we really want is the first five
groups.
What I did was use an IN query to pull in just the raw totals for the
highest 4 rows and then use those results in the HAVING clause. The main
query does not use a TOP clause because we are limited by the HAVING.
create table #test (Attr varchar(10))
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr2')
insert into #test values ('Attr2')
insert into #test values ('Attr2')
insert into #test values ('Attr3')
insert into #test values ('Attr3')
insert into #test values ('Attr3')
insert into #test values ('Attr4')
insert into #test values ('Attr4')
insert into #test values ('Attr5')
insert into #test values ('Attr5')
select Attr, COUNT(*) as 'Count'
from #test
Group By Attr
Having COUNT(*) IN (
select TOP 4 COUNT(*) as 'Count'
from #test
Group By Attr
Order By 1 Desc)
Order By 2 Desc
David Gugick
Imceda Software
www.imceda.com|||On Wed, 22 Sep 2004 18:59:03 -0700, MTKIRWAN wrote:
> However I want the result set to list the top 10 records. This could be
> done using the top 10 function. However as you can see Attribute value
>10 and 11 both have the total of 2 and are therefore equilvalent. So I
> really want the top 11 returned in this case. If Attribute value 12
>had been 2 then I would have wanted the top 12 etc
> How can I do this?
TOP 10 WITH TIES
?
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Hugo Kornelis wrote:
> On Wed, 22 Sep 2004 18:59:03 -0700, MTKIRWAN wrote:
>> However I want the result set to list the top 10 records. This could
>> be done using the top 10 function. However as you can see Attribute
>> value 10 and 11 both have the total of 2 and are therefore
>> equilvalent. So I really want the top 11 returned in this case. If
>> Attribute value 12 had been 2 then I would have wanted the top 12 etc
>> How can I do this?
> TOP 10 WITH TIES
> ?
> Best, Hugo
I guess you learn something every day. Never knew.
--
David Gugick
Imceda Software
www.imceda.com
in the database ie
Attribute value 1 6
Attribute value 2 5
Attribute value 3 5
Attribute value 4 4
Attribute value 5 4
Attribute value 6 3
Attribute value 7 3
Attribute value 8 3
Attribute value 9 3
Attribute value 10 2
Attribute value 11 2
Attribute value 12 1
Attribute value 13 1
However I want the result set to list the top 10 records. This could be
done using the top 10 function. However as you can see Attribute value
10 and 11 both have the total of 2 and are therefore equilvalent. So I
really want the top 11 returned in this case. If Attribute value 12
had been 2 then I would have wanted the top 12 etc
How can I do this?MTKIRWAN wrote:
> I want to list a particular attribute value and the number of times
> it occurs in the database ie
> Attribute value 1 6
> Attribute value 2 5
> Attribute value 3 5
> Attribute value 4 4
> Attribute value 5 4
> Attribute value 6 3
> Attribute value 7 3
> Attribute value 8 3
> Attribute value 9 3
> Attribute value 10 2
> Attribute value 11 2
> Attribute value 12 1
> Attribute value 13 1
> However I want the result set to list the top 10 records. This could
> be done using the top 10 function. However as you can see Attribute
> value 10 and 11 both have the total of 2 and are therefore
> equilvalent. So I really want the top 11 returned in this case. If
> Attribute value 12
> had been 2 then I would have wanted the top 12 etc
> How can I do this?
Try something like this:
In this example, I'm looking for the TOP 4. There are 6 groups. If you
run a GROUP BY with COUNT in DESC order on the COUNT, you'll see we have
a matching count on 4 and 5, so what we really want is the first five
groups.
What I did was use an IN query to pull in just the raw totals for the
highest 4 rows and then use those results in the HAVING clause. The main
query does not use a TOP clause because we are limited by the HAVING.
create table #test (Attr varchar(10))
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr1')
insert into #test values ('Attr2')
insert into #test values ('Attr2')
insert into #test values ('Attr2')
insert into #test values ('Attr3')
insert into #test values ('Attr3')
insert into #test values ('Attr3')
insert into #test values ('Attr4')
insert into #test values ('Attr4')
insert into #test values ('Attr5')
insert into #test values ('Attr5')
select Attr, COUNT(*) as 'Count'
from #test
Group By Attr
Having COUNT(*) IN (
select TOP 4 COUNT(*) as 'Count'
from #test
Group By Attr
Order By 1 Desc)
Order By 2 Desc
David Gugick
Imceda Software
www.imceda.com|||On Wed, 22 Sep 2004 18:59:03 -0700, MTKIRWAN wrote:
> However I want the result set to list the top 10 records. This could be
> done using the top 10 function. However as you can see Attribute value
>10 and 11 both have the total of 2 and are therefore equilvalent. So I
> really want the top 11 returned in this case. If Attribute value 12
>had been 2 then I would have wanted the top 12 etc
> How can I do this?
TOP 10 WITH TIES
?
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Hugo Kornelis wrote:
> On Wed, 22 Sep 2004 18:59:03 -0700, MTKIRWAN wrote:
>> However I want the result set to list the top 10 records. This could
>> be done using the top 10 function. However as you can see Attribute
>> value 10 and 11 both have the total of 2 and are therefore
>> equilvalent. So I really want the top 11 returned in this case. If
>> Attribute value 12 had been 2 then I would have wanted the top 12 etc
>> How can I do this?
> TOP 10 WITH TIES
> ?
> Best, Hugo
I guess you learn something every day. Never knew.
--
David Gugick
Imceda Software
www.imceda.com
Limiting the amount of data used between two tables
Two tables: People and TestValues
People
--
Name varchar(50)
TestValues
--
TestString varchar(10)
Insert into People (Name) values ('William')
Insert into People (Name) values ('Blake')
Insert into People (Name) values ('Kevin')
Insert into People (Name) values ('Merry')
Insert into People (Name) values ('Gary')
Insert into People (Name) values ('Tamara')
Insert into People (Name) values ('Rich')
insert into TestValues (testString) values ('A')
insert into TestValues (testString) values ('M')
insert into TestValues (testString) values ('K')
insert into TestValues (testString) values ('X')
insert into TestValues (testString) values ('Z')
The goal is to have each table filter the other, so that we only return
those items that they have in common. So:
'William' has an "A", so WIlliam and A both are included (there is also
an M, but A is a match so M is not necessary)
"Blake" has an "A", so both are included
"Kevin" has a "K"
"Merry" matches "M"
"Gary" matches "A"
"Rich" doesn't match anything, and isn't included
"X" and "Z" don't match, and aren't included
I would rather not create two cursors and two temp tables if there is a
set based way to do this. Thanks!
- Wm in Kansas Cityselect p.name, min(t.teststring) as teststring
from people p
join testvalues t on p.name like '%'+t.teststring+'%'
group by p.name
this probably won't perform very well, especially if the amount of data
gets large.
seamlyne@.hotmail.com wrote:
> Two tables: People and TestValues
> People
> --
> Name varchar(50)
>
> TestValues
> --
> TestString varchar(10)
>
> Insert into People (Name) values ('William')
> Insert into People (Name) values ('Blake')
> Insert into People (Name) values ('Kevin')
> Insert into People (Name) values ('Merry')
> Insert into People (Name) values ('Gary')
> Insert into People (Name) values ('Tamara')
> Insert into People (Name) values ('Rich')
>
> insert into TestValues (testString) values ('A')
> insert into TestValues (testString) values ('M')
> insert into TestValues (testString) values ('K')
> insert into TestValues (testString) values ('X')
> insert into TestValues (testString) values ('Z')
> The goal is to have each table filter the other, so that we only return
> those items that they have in common. So:
> 'William' has an "A", so WIlliam and A both are included (there is also
> an M, but A is a match so M is not necessary)
> "Blake" has an "A", so both are included
> "Kevin" has a "K"
> "Merry" matches "M"
> "Gary" matches "A"
> "Rich" doesn't match anything, and isn't included
> "X" and "Z" don't match, and aren't included
> I would rather not create two cursors and two temp tables if there is a
> set based way to do this. Thanks!
> - Wm in Kansas City
>|||select * from #people join #TestValues on charindex(testString, Name)>0
People
--
Name varchar(50)
TestValues
--
TestString varchar(10)
Insert into People (Name) values ('William')
Insert into People (Name) values ('Blake')
Insert into People (Name) values ('Kevin')
Insert into People (Name) values ('Merry')
Insert into People (Name) values ('Gary')
Insert into People (Name) values ('Tamara')
Insert into People (Name) values ('Rich')
insert into TestValues (testString) values ('A')
insert into TestValues (testString) values ('M')
insert into TestValues (testString) values ('K')
insert into TestValues (testString) values ('X')
insert into TestValues (testString) values ('Z')
The goal is to have each table filter the other, so that we only return
those items that they have in common. So:
'William' has an "A", so WIlliam and A both are included (there is also
an M, but A is a match so M is not necessary)
"Blake" has an "A", so both are included
"Kevin" has a "K"
"Merry" matches "M"
"Gary" matches "A"
"Rich" doesn't match anything, and isn't included
"X" and "Z" don't match, and aren't included
I would rather not create two cursors and two temp tables if there is a
set based way to do this. Thanks!
- Wm in Kansas Cityselect p.name, min(t.teststring) as teststring
from people p
join testvalues t on p.name like '%'+t.teststring+'%'
group by p.name
this probably won't perform very well, especially if the amount of data
gets large.
seamlyne@.hotmail.com wrote:
> Two tables: People and TestValues
> People
> --
> Name varchar(50)
>
> TestValues
> --
> TestString varchar(10)
>
> Insert into People (Name) values ('William')
> Insert into People (Name) values ('Blake')
> Insert into People (Name) values ('Kevin')
> Insert into People (Name) values ('Merry')
> Insert into People (Name) values ('Gary')
> Insert into People (Name) values ('Tamara')
> Insert into People (Name) values ('Rich')
>
> insert into TestValues (testString) values ('A')
> insert into TestValues (testString) values ('M')
> insert into TestValues (testString) values ('K')
> insert into TestValues (testString) values ('X')
> insert into TestValues (testString) values ('Z')
> The goal is to have each table filter the other, so that we only return
> those items that they have in common. So:
> 'William' has an "A", so WIlliam and A both are included (there is also
> an M, but A is a match so M is not necessary)
> "Blake" has an "A", so both are included
> "Kevin" has a "K"
> "Merry" matches "M"
> "Gary" matches "A"
> "Rich" doesn't match anything, and isn't included
> "X" and "Z" don't match, and aren't included
> I would rather not create two cursors and two temp tables if there is a
> set based way to do this. Thanks!
> - Wm in Kansas City
>|||select * from #people join #TestValues on charindex(testString, Name)>0
Friday, March 9, 2012
Limiting Amount of Text in a box
I have Comments field in my db that can contain many lines of text and when
it displays in the report the textbox grow extensively. How can I limit the
amount that the text box grows, OR limit the amount of text that is
retrieved in my query, i.e., I only want to display 10-15 lines out of
potentially 80-100.
Thanks
DeanYou can try to show only the first N characters doing it in your SQL
sentence or in the Cell Expresion:
IN SQL:
SELECT substring(YourtextField, 1, N) as Comments, ... FROM YourTable
IN Your cell expresion:
= Mid(Fields!YourField.Value, 1, N)
Does it help?
"Dean" <deanl144@.hotmail.com.nospam> escribió en el mensaje
news:%23M8giJhIIHA.5764@.TK2MSFTNGP06.phx.gbl...
>I have Comments field in my db that can contain many lines of text and when
>it displays in the report the textbox grow extensively. How can I limit the
>amount that the text box grows, OR limit the amount of text that is
>retrieved in my query, i.e., I only want to display 10-15 lines out of
>potentially 80-100.
> Thanks
> Dean
>|||On Nov 8, 9:19 am, "Dean" <deanl...@.hotmail.com.nospam> wrote:
> I have Comments field in my db that can contain many lines of text and when
> it displays in the report the textbox grow extensively. How can I limit the
> amount that the text box grows, OR limit the amount of text that is
> retrieved in my query, i.e., I only want to display 10-15 lines out of
> potentially 80-100.
> Thanks
> Dean
You could create a custom code that counts the carriage return
characters (vbCr, vbLf, vbCrLf depending on your encoding), and if
there are more than 10 in your input string, truncate it using the
Left function
Off the top of my head, it would look something like this:
Function TextTrimmer( txt As String ) As String
lineCount = 0
returnOffset = 1
While lineCount < 10 and returnOffset > 0
returnOffset = InStr( returnOffset+1, txt, vbCr)
lineCount = lineCount + 1
Wend
If returnOffset = 0 Then
' ran out of characters in the string before reaching 10 lines
return( txt )
Else
return( Left( txt, returnOffset-1 ) & "..." )
End If
End Function
Then in the textbox, use
=Code.TextTrimmer( Fields!ReallyLongText.Value )
-- Scott
it displays in the report the textbox grow extensively. How can I limit the
amount that the text box grows, OR limit the amount of text that is
retrieved in my query, i.e., I only want to display 10-15 lines out of
potentially 80-100.
Thanks
DeanYou can try to show only the first N characters doing it in your SQL
sentence or in the Cell Expresion:
IN SQL:
SELECT substring(YourtextField, 1, N) as Comments, ... FROM YourTable
IN Your cell expresion:
= Mid(Fields!YourField.Value, 1, N)
Does it help?
"Dean" <deanl144@.hotmail.com.nospam> escribió en el mensaje
news:%23M8giJhIIHA.5764@.TK2MSFTNGP06.phx.gbl...
>I have Comments field in my db that can contain many lines of text and when
>it displays in the report the textbox grow extensively. How can I limit the
>amount that the text box grows, OR limit the amount of text that is
>retrieved in my query, i.e., I only want to display 10-15 lines out of
>potentially 80-100.
> Thanks
> Dean
>|||On Nov 8, 9:19 am, "Dean" <deanl...@.hotmail.com.nospam> wrote:
> I have Comments field in my db that can contain many lines of text and when
> it displays in the report the textbox grow extensively. How can I limit the
> amount that the text box grows, OR limit the amount of text that is
> retrieved in my query, i.e., I only want to display 10-15 lines out of
> potentially 80-100.
> Thanks
> Dean
You could create a custom code that counts the carriage return
characters (vbCr, vbLf, vbCrLf depending on your encoding), and if
there are more than 10 in your input string, truncate it using the
Left function
Off the top of my head, it would look something like this:
Function TextTrimmer( txt As String ) As String
lineCount = 0
returnOffset = 1
While lineCount < 10 and returnOffset > 0
returnOffset = InStr( returnOffset+1, txt, vbCr)
lineCount = lineCount + 1
Wend
If returnOffset = 0 Then
' ran out of characters in the string before reaching 10 lines
return( txt )
Else
return( Left( txt, returnOffset-1 ) & "..." )
End If
End Function
Then in the textbox, use
=Code.TextTrimmer( Fields!ReallyLongText.Value )
-- Scott
Wednesday, March 7, 2012
Limitayion of indexes
Hello there
I've been heard that after amount of data on table (Approx 1,000,000 records
and more) according to the type of index, the index performance is become
mutch more slower.
Does someone knows what is the limitation and how can i handle of it?Roy,shalom
It depends on how often your table is acceseed (insert/update/deleted) .
What is a WHERE condion and how often is changed. I'd prefer to rebuild
indexes on all my user tables one a w
.
"Roy Goldhammer" <roy@.hotmail.com> wrote in message
news:%23Cxk3h$SGHA.6084@.TK2MSFTNGP14.phx.gbl...
> Hello there
> I've been heard that after amount of data on table (Approx 1,000,000
> records and more) according to the type of index, the index performance is
> become mutch more slower.
> Does someone knows what is the limitation and how can i handle of it?
>|||Whell Uri
Have you ever worked with approx 10,000,000 records?
and i know that there is fill factor for this case.
Do you have any idea for what is use?
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23HcZEl$SGHA.5828@.TK2MSFTNGP14.phx.gbl...
> Roy,shalom
> It depends on how often your table is acceseed (insert/update/deleted) .
> What is a WHERE condion and how often is changed. I'd prefer to rebuild
> indexes on all my user tables one a w
.
>
> "Roy Goldhammer" <roy@.hotmail.com> wrote in message
> news:%23Cxk3h$SGHA.6084@.TK2MSFTNGP14.phx.gbl...
>|||Roy
> Have you ever worked with approx 10,000,000 records?
:-))) Yes , even much much more
> and i know that there is fill factor for this case.
Yes , FillFactor is created along with a creation of index on the table
> Do you have any idea for what is use?
Do you want to know what FILLFACTOR to put on the table?
"Roy Goldhammer" <roy@.hotmail.com> wrote in message
news:O%23Rwtu$SGHA.5736@.TK2MSFTNGP10.phx.gbl...
> Whell Uri
> Have you ever worked with approx 10,000,000 records?
> and i know that there is fill factor for this case.
> Do you have any idea for what is use?
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:%23HcZEl$SGHA.5828@.TK2MSFTNGP14.phx.gbl...
>|||Index fragmentation can increase the amount of I/O required to scan an
index, and this would be more likely and noticable on large tables. DBCC
SHOWCONTIG will reveal the amount of fragmentation and DBCC DBREINDEX or
DBCC INDEXDEFRAG can be occasionally run the correct the problem, which
typically accumulates over time.
Understanding SQL Server's DBCC SHOWCONTIG:
http://www.sql-server-performance.c..._showcontig.asp
Microsoft SQL Server 2000 Index Defragmentation Best Practices:
http://www.microsoft.com/technet/pr...n/ss2kidbp.mspx
"Roy Goldhammer" <roy@.hotmail.com> wrote in message
news:%23Cxk3h$SGHA.6084@.TK2MSFTNGP14.phx.gbl...
> Hello there
> I've been heard that after amount of data on table (Approx 1,000,000
> records and more) according to the type of index, the index performance is
> become mutch more slower.
> Does someone knows what is the limitation and how can i handle of it?
>
I've been heard that after amount of data on table (Approx 1,000,000 records
and more) according to the type of index, the index performance is become
mutch more slower.
Does someone knows what is the limitation and how can i handle of it?Roy,shalom
It depends on how often your table is acceseed (insert/update/deleted) .
What is a WHERE condion and how often is changed. I'd prefer to rebuild
indexes on all my user tables one a w
"Roy Goldhammer" <roy@.hotmail.com> wrote in message
news:%23Cxk3h$SGHA.6084@.TK2MSFTNGP14.phx.gbl...
> Hello there
> I've been heard that after amount of data on table (Approx 1,000,000
> records and more) according to the type of index, the index performance is
> become mutch more slower.
> Does someone knows what is the limitation and how can i handle of it?
>|||Whell Uri
Have you ever worked with approx 10,000,000 records?
and i know that there is fill factor for this case.
Do you have any idea for what is use?
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23HcZEl$SGHA.5828@.TK2MSFTNGP14.phx.gbl...
> Roy,shalom
> It depends on how often your table is acceseed (insert/update/deleted) .
> What is a WHERE condion and how often is changed. I'd prefer to rebuild
> indexes on all my user tables one a w
>
> "Roy Goldhammer" <roy@.hotmail.com> wrote in message
> news:%23Cxk3h$SGHA.6084@.TK2MSFTNGP14.phx.gbl...
>|||Roy
> Have you ever worked with approx 10,000,000 records?
:-))) Yes , even much much more
> and i know that there is fill factor for this case.
Yes , FillFactor is created along with a creation of index on the table
> Do you have any idea for what is use?
Do you want to know what FILLFACTOR to put on the table?
"Roy Goldhammer" <roy@.hotmail.com> wrote in message
news:O%23Rwtu$SGHA.5736@.TK2MSFTNGP10.phx.gbl...
> Whell Uri
> Have you ever worked with approx 10,000,000 records?
> and i know that there is fill factor for this case.
> Do you have any idea for what is use?
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:%23HcZEl$SGHA.5828@.TK2MSFTNGP14.phx.gbl...
>|||Index fragmentation can increase the amount of I/O required to scan an
index, and this would be more likely and noticable on large tables. DBCC
SHOWCONTIG will reveal the amount of fragmentation and DBCC DBREINDEX or
DBCC INDEXDEFRAG can be occasionally run the correct the problem, which
typically accumulates over time.
Understanding SQL Server's DBCC SHOWCONTIG:
http://www.sql-server-performance.c..._showcontig.asp
Microsoft SQL Server 2000 Index Defragmentation Best Practices:
http://www.microsoft.com/technet/pr...n/ss2kidbp.mspx
"Roy Goldhammer" <roy@.hotmail.com> wrote in message
news:%23Cxk3h$SGHA.6084@.TK2MSFTNGP14.phx.gbl...
> Hello there
> I've been heard that after amount of data on table (Approx 1,000,000
> records and more) according to the type of index, the index performance is
> become mutch more slower.
> Does someone knows what is the limitation and how can i handle of it?
>
Monday, February 20, 2012
limit the no. of users
I have an application that uses a small SQL Server database.
What I need is to prevent the access of an amount of users to the database.
At the beginning I want to limit the access only for 2 users but I want to be able in the future to grant the access to more.u can limit no: of concurrent users at server level,but U cant limit no: of user at database level from sql server.|||Actually, I want only 2 users to be able to use my application at the same time and I cant figure out which is the best solution to implement this.|||what kind of application is that? web based or windows based?
Is that application is installed on each computer or shared thru network if it is windows based?|||It's a windows client-server application.
I am thinking of giving a session ID when a user log in. Every time the client uses the database I'll check the session ID if is valid.
When the client try to log in the 2nd time I'll give him another Session ID and I'll destroy the other one.
I have also to limit the session ID numbers to 2 for the beginning and I'll ignore users that are not in the top 2.
What do u thinck about this?|||the solution you suggested will work, but the problem with it is - it requires maintenance module to manually disconnect users those who have accidentally or by mistake closed the application/machine without proper logout.
SQL server allows you to create unique application objects and lock them during execution. I think that can be an alternative solution to the problem. check sp_getapplock on BOL. the best thing is - it automatically releases the lock as soon as the connection is lost.
What I need is to prevent the access of an amount of users to the database.
At the beginning I want to limit the access only for 2 users but I want to be able in the future to grant the access to more.u can limit no: of concurrent users at server level,but U cant limit no: of user at database level from sql server.|||Actually, I want only 2 users to be able to use my application at the same time and I cant figure out which is the best solution to implement this.|||what kind of application is that? web based or windows based?
Is that application is installed on each computer or shared thru network if it is windows based?|||It's a windows client-server application.
I am thinking of giving a session ID when a user log in. Every time the client uses the database I'll check the session ID if is valid.
When the client try to log in the 2nd time I'll give him another Session ID and I'll destroy the other one.
I have also to limit the session ID numbers to 2 for the beginning and I'll ignore users that are not in the top 2.
What do u thinck about this?|||the solution you suggested will work, but the problem with it is - it requires maintenance module to manually disconnect users those who have accidentally or by mistake closed the application/machine without proper logout.
SQL server allows you to create unique application objects and lock them during execution. I think that can be an alternative solution to the problem. check sp_getapplock on BOL. the best thing is - it automatically releases the lock as soon as the connection is lost.
Limit the Amount of Time for each job
Is there away to place at the beginning of a SQL Server job step the maximum
of amount you would like this step to execute. If the job steps executes
greater than this amount kill the step and go to the next step.
Please help me with this issue.
Thanks,maximum amount of what?
"Joe K." wrote:
> Is there away to place at the beginning of a SQL Server job step the maxim
um
> of amount you would like this step to execute. If the job steps executes
> greater than this amount kill the step and go to the next step.
> Please help me with this issue.
> Thanks,
>|||Fix the step
"Joe K." <JoeK@.discussions.microsoft.com> wrote in message
news:6C8530C7-174C-4E05-88D0-90CA2AD4EF52@.microsoft.com...
> Is there away to place at the beginning of a SQL Server job step the
maximum
> of amount you would like this step to execute. If the job steps executes
> greater than this amount kill the step and go to the next step.
> Please help me with this issue.
> Thanks,
>
of amount you would like this step to execute. If the job steps executes
greater than this amount kill the step and go to the next step.
Please help me with this issue.
Thanks,maximum amount of what?
"Joe K." wrote:
> Is there away to place at the beginning of a SQL Server job step the maxim
um
> of amount you would like this step to execute. If the job steps executes
> greater than this amount kill the step and go to the next step.
> Please help me with this issue.
> Thanks,
>|||Fix the step
"Joe K." <JoeK@.discussions.microsoft.com> wrote in message
news:6C8530C7-174C-4E05-88D0-90CA2AD4EF52@.microsoft.com...
> Is there away to place at the beginning of a SQL Server job step the
maximum
> of amount you would like this step to execute. If the job steps executes
> greater than this amount kill the step and go to the next step.
> Please help me with this issue.
> Thanks,
>
Limit the Amount of Time for each job
Is there away to place at the beginning of a SQL Server job step the maximum
of amount you would like this step to execute. If the job steps executes
greater than this amount kill the step and go to the next step.
Please help me with this issue.
Thanks,
maximum amount of what?
"Joe K." wrote:
> Is there away to place at the beginning of a SQL Server job step the maximum
> of amount you would like this step to execute. If the job steps executes
> greater than this amount kill the step and go to the next step.
> Please help me with this issue.
> Thanks,
>
|||Fix the step
"Joe K." <JoeK@.discussions.microsoft.com> wrote in message
news:6C8530C7-174C-4E05-88D0-90CA2AD4EF52@.microsoft.com...
> Is there away to place at the beginning of a SQL Server job step the
maximum
> of amount you would like this step to execute. If the job steps executes
> greater than this amount kill the step and go to the next step.
> Please help me with this issue.
> Thanks,
>
of amount you would like this step to execute. If the job steps executes
greater than this amount kill the step and go to the next step.
Please help me with this issue.
Thanks,
maximum amount of what?
"Joe K." wrote:
> Is there away to place at the beginning of a SQL Server job step the maximum
> of amount you would like this step to execute. If the job steps executes
> greater than this amount kill the step and go to the next step.
> Please help me with this issue.
> Thanks,
>
|||Fix the step
"Joe K." <JoeK@.discussions.microsoft.com> wrote in message
news:6C8530C7-174C-4E05-88D0-90CA2AD4EF52@.microsoft.com...
> Is there away to place at the beginning of a SQL Server job step the
maximum
> of amount you would like this step to execute. If the job steps executes
> greater than this amount kill the step and go to the next step.
> Please help me with this issue.
> Thanks,
>
Limit the Amount of Time for each job
Is there away to place at the beginning of a SQL Server job step the maximum
of amount you would like this step to execute. If the job steps executes
greater than this amount kill the step and go to the next step.
Please help me with this issue.
Thanks,maximum amount of what?
"Joe K." wrote:
> Is there away to place at the beginning of a SQL Server job step the maximum
> of amount you would like this step to execute. If the job steps executes
> greater than this amount kill the step and go to the next step.
> Please help me with this issue.
> Thanks,
>|||Fix the step
"Joe K." <JoeK@.discussions.microsoft.com> wrote in message
news:6C8530C7-174C-4E05-88D0-90CA2AD4EF52@.microsoft.com...
> Is there away to place at the beginning of a SQL Server job step the
maximum
> of amount you would like this step to execute. If the job steps executes
> greater than this amount kill the step and go to the next step.
> Please help me with this issue.
> Thanks,
>
of amount you would like this step to execute. If the job steps executes
greater than this amount kill the step and go to the next step.
Please help me with this issue.
Thanks,maximum amount of what?
"Joe K." wrote:
> Is there away to place at the beginning of a SQL Server job step the maximum
> of amount you would like this step to execute. If the job steps executes
> greater than this amount kill the step and go to the next step.
> Please help me with this issue.
> Thanks,
>|||Fix the step
"Joe K." <JoeK@.discussions.microsoft.com> wrote in message
news:6C8530C7-174C-4E05-88D0-90CA2AD4EF52@.microsoft.com...
> Is there away to place at the beginning of a SQL Server job step the
maximum
> of amount you would like this step to execute. If the job steps executes
> greater than this amount kill the step and go to the next step.
> Please help me with this issue.
> Thanks,
>
Limit SQLEXPRESS Memory?
Is there some way to limit the amount of memmory grabbed by SQLEXPRESS as there is with SQL 2000? TaskManager shows it taking 1.4 gig on my server. 2 gig total memory in the machine. I'd like to limit it to someting less.
This statement was captured from a trace when i lowered the max memory to 123MB for my development box which is running SQL2K.
exec sp_configure N'max server memory (MB)', 123
I would suspect it to behave similarly on sql express.
|||Thanks but that produces an error of
The configuration option 'max server memory (MB)' does not exist, or it may be an advanced option.
Any other ideas?
|||Advanced options are required. The following will set sqlexpress to 700 mb max server memory and then show all settings:
use master
Go
exec sp_configure 'show advanced options', 1;
Go
RECONFIGURE;
GO
exec sp_configure 'max server memory (MB)', 700;
GO
RECONFIGURE;
GO
SELECT * FROM sys.configurations
ORDER BY name ;
GO
Limit server resources per query
Hello,
I've got a huge query that takes a fair amount of time to
run, and ideally this query will be run in the middle of
the night, so I wont have any issues with any customer
facing applications...
However in testing, I need to develop this report in the
daytime, and dont have the liberty of having a development
server. I was curious if in a sql statement, I could
specify that I'd rather have a query take longer, than
prevent other applications from being able to process data
in a timely fashion. (I get timeouts etc in the other apps)
As it sits this query takes about 4 minutes on a quite
fast sql server, and I dont mind it so much, but it seems
in that 4 minutes, other services are really hurting.
Thanks in advance,
Weston Weems
There is no option such as the one you describe but you can add MAXDOP hints
to the sql statements that will limit the number of processors used by the
query. So if you have 4 procs you can set it to 2 and leave 2 for the other
users. It may take longer but should be more respectful of the other users.
Andrew J. Kelly SQL MVP
"Weston Weems" <anonymous@.discussions.microsoft.com> wrote in message
news:0ae401c51848$8b06fc90$a501280a@.phx.gbl...
> Hello,
> I've got a huge query that takes a fair amount of time to
> run, and ideally this query will be run in the middle of
> the night, so I wont have any issues with any customer
> facing applications...
> However in testing, I need to develop this report in the
> daytime, and dont have the liberty of having a development
> server. I was curious if in a sql statement, I could
> specify that I'd rather have a query take longer, than
> prevent other applications from being able to process data
> in a timely fashion. (I get timeouts etc in the other apps)
> As it sits this query takes about 4 minutes on a quite
> fast sql server, and I dont mind it so much, but it seems
> in that 4 minutes, other services are really hurting.
> Thanks in advance,
> Weston Weems
I've got a huge query that takes a fair amount of time to
run, and ideally this query will be run in the middle of
the night, so I wont have any issues with any customer
facing applications...
However in testing, I need to develop this report in the
daytime, and dont have the liberty of having a development
server. I was curious if in a sql statement, I could
specify that I'd rather have a query take longer, than
prevent other applications from being able to process data
in a timely fashion. (I get timeouts etc in the other apps)
As it sits this query takes about 4 minutes on a quite
fast sql server, and I dont mind it so much, but it seems
in that 4 minutes, other services are really hurting.
Thanks in advance,
Weston Weems
There is no option such as the one you describe but you can add MAXDOP hints
to the sql statements that will limit the number of processors used by the
query. So if you have 4 procs you can set it to 2 and leave 2 for the other
users. It may take longer but should be more respectful of the other users.
Andrew J. Kelly SQL MVP
"Weston Weems" <anonymous@.discussions.microsoft.com> wrote in message
news:0ae401c51848$8b06fc90$a501280a@.phx.gbl...
> Hello,
> I've got a huge query that takes a fair amount of time to
> run, and ideally this query will be run in the middle of
> the night, so I wont have any issues with any customer
> facing applications...
> However in testing, I need to develop this report in the
> daytime, and dont have the liberty of having a development
> server. I was curious if in a sql statement, I could
> specify that I'd rather have a query take longer, than
> prevent other applications from being able to process data
> in a timely fashion. (I get timeouts etc in the other apps)
> As it sits this query takes about 4 minutes on a quite
> fast sql server, and I dont mind it so much, but it seems
> in that 4 minutes, other services are really hurting.
> Thanks in advance,
> Weston Weems
Limit server resources per query
Hello,
I've got a huge query that takes a fair amount of time to
run, and ideally this query will be run in the middle of
the night, so I wont have any issues with any customer
facing applications...
However in testing, I need to develop this report in the
daytime, and dont have the liberty of having a development
server. I was curious if in a sql statement, I could
specify that I'd rather have a query take longer, than
prevent other applications from being able to process data
in a timely fashion. (I get timeouts etc in the other apps)
As it sits this query takes about 4 minutes on a quite
fast sql server, and I dont mind it so much, but it seems
in that 4 minutes, other services are really hurting.
Thanks in advance,
Weston WeemsThere is no option such as the one you describe but you can add MAXDOP hints
to the sql statements that will limit the number of processors used by the
query. So if you have 4 procs you can set it to 2 and leave 2 for the other
users. It may take longer but should be more respectful of the other users.
--
Andrew J. Kelly SQL MVP
"Weston Weems" <anonymous@.discussions.microsoft.com> wrote in message
news:0ae401c51848$8b06fc90$a501280a@.phx.gbl...
> Hello,
> I've got a huge query that takes a fair amount of time to
> run, and ideally this query will be run in the middle of
> the night, so I wont have any issues with any customer
> facing applications...
> However in testing, I need to develop this report in the
> daytime, and dont have the liberty of having a development
> server. I was curious if in a sql statement, I could
> specify that I'd rather have a query take longer, than
> prevent other applications from being able to process data
> in a timely fashion. (I get timeouts etc in the other apps)
> As it sits this query takes about 4 minutes on a quite
> fast sql server, and I dont mind it so much, but it seems
> in that 4 minutes, other services are really hurting.
> Thanks in advance,
> Weston Weems
I've got a huge query that takes a fair amount of time to
run, and ideally this query will be run in the middle of
the night, so I wont have any issues with any customer
facing applications...
However in testing, I need to develop this report in the
daytime, and dont have the liberty of having a development
server. I was curious if in a sql statement, I could
specify that I'd rather have a query take longer, than
prevent other applications from being able to process data
in a timely fashion. (I get timeouts etc in the other apps)
As it sits this query takes about 4 minutes on a quite
fast sql server, and I dont mind it so much, but it seems
in that 4 minutes, other services are really hurting.
Thanks in advance,
Weston WeemsThere is no option such as the one you describe but you can add MAXDOP hints
to the sql statements that will limit the number of processors used by the
query. So if you have 4 procs you can set it to 2 and leave 2 for the other
users. It may take longer but should be more respectful of the other users.
--
Andrew J. Kelly SQL MVP
"Weston Weems" <anonymous@.discussions.microsoft.com> wrote in message
news:0ae401c51848$8b06fc90$a501280a@.phx.gbl...
> Hello,
> I've got a huge query that takes a fair amount of time to
> run, and ideally this query will be run in the middle of
> the night, so I wont have any issues with any customer
> facing applications...
> However in testing, I need to develop this report in the
> daytime, and dont have the liberty of having a development
> server. I was curious if in a sql statement, I could
> specify that I'd rather have a query take longer, than
> prevent other applications from being able to process data
> in a timely fashion. (I get timeouts etc in the other apps)
> As it sits this query takes about 4 minutes on a quite
> fast sql server, and I dont mind it so much, but it seems
> in that 4 minutes, other services are really hurting.
> Thanks in advance,
> Weston Weems
Limit server resources per query
Hello,
I've got a huge query that takes a fair amount of time to
run, and ideally this query will be run in the middle of
the night, so I wont have any issues with any customer
facing applications...
However in testing, I need to develop this report in the
daytime, and dont have the liberty of having a development
server. I was curious if in a sql statement, I could
specify that I'd rather have a query take longer, than
prevent other applications from being able to process data
in a timely fashion. (I get timeouts etc in the other apps)
As it sits this query takes about 4 minutes on a quite
fast sql server, and I dont mind it so much, but it seems
in that 4 minutes, other services are really hurting.
Thanks in advance,
Weston WeemsThere is no option such as the one you describe but you can add MAXDOP hints
to the sql statements that will limit the number of processors used by the
query. So if you have 4 procs you can set it to 2 and leave 2 for the other
users. It may take longer but should be more respectful of the other users.
Andrew J. Kelly SQL MVP
"Weston Weems" <anonymous@.discussions.microsoft.com> wrote in message
news:0ae401c51848$8b06fc90$a501280a@.phx.gbl...
> Hello,
> I've got a huge query that takes a fair amount of time to
> run, and ideally this query will be run in the middle of
> the night, so I wont have any issues with any customer
> facing applications...
> However in testing, I need to develop this report in the
> daytime, and dont have the liberty of having a development
> server. I was curious if in a sql statement, I could
> specify that I'd rather have a query take longer, than
> prevent other applications from being able to process data
> in a timely fashion. (I get timeouts etc in the other apps)
> As it sits this query takes about 4 minutes on a quite
> fast sql server, and I dont mind it so much, but it seems
> in that 4 minutes, other services are really hurting.
> Thanks in advance,
> Weston Weems
I've got a huge query that takes a fair amount of time to
run, and ideally this query will be run in the middle of
the night, so I wont have any issues with any customer
facing applications...
However in testing, I need to develop this report in the
daytime, and dont have the liberty of having a development
server. I was curious if in a sql statement, I could
specify that I'd rather have a query take longer, than
prevent other applications from being able to process data
in a timely fashion. (I get timeouts etc in the other apps)
As it sits this query takes about 4 minutes on a quite
fast sql server, and I dont mind it so much, but it seems
in that 4 minutes, other services are really hurting.
Thanks in advance,
Weston WeemsThere is no option such as the one you describe but you can add MAXDOP hints
to the sql statements that will limit the number of processors used by the
query. So if you have 4 procs you can set it to 2 and leave 2 for the other
users. It may take longer but should be more respectful of the other users.
Andrew J. Kelly SQL MVP
"Weston Weems" <anonymous@.discussions.microsoft.com> wrote in message
news:0ae401c51848$8b06fc90$a501280a@.phx.gbl...
> Hello,
> I've got a huge query that takes a fair amount of time to
> run, and ideally this query will be run in the middle of
> the night, so I wont have any issues with any customer
> facing applications...
> However in testing, I need to develop this report in the
> daytime, and dont have the liberty of having a development
> server. I was curious if in a sql statement, I could
> specify that I'd rather have a query take longer, than
> prevent other applications from being able to process data
> in a timely fashion. (I get timeouts etc in the other apps)
> As it sits this query takes about 4 minutes on a quite
> fast sql server, and I dont mind it so much, but it seems
> in that 4 minutes, other services are really hurting.
> Thanks in advance,
> Weston Weems
Subscribe to:
Posts (Atom)