显示标签为“current”的博文。显示所有博文
显示标签为“current”的博文。显示所有博文

2012年3月27日星期二

Fliegroups and Primary Keys

I have a question with regads to placement of data files/indexes on
multiple filegroups. Here is the current scenario:

I have a database comprised of two filegroups - PRIMARY and INDEX. The
PRIMARY filegroup is comprised of two files, one residing on the R
drive and another residing on the O drive. The INDEX filegroup
consists of a file on the S drive. The transaction logs reside on the
T drive. The box itself has five individual drive slots, not RAID'ed
or mirrored. The tables are created in the PRIMARY filegroup, the
indexes in the INDEX group.

My question is this: is there any inherent benefit to create the
PRIMARY KEYS in a different filegroup? Currently, they are being
created in the PRIMARY group along with the actual data tables.

Thank you in adavance for any help.

Anthony RobinsonAnthony Robinson (ansonee@.yahoo.com) writes:
> This might seem kind of odd, but I'm going to answer my own question:
> no, you can't put a clustered (primary key) index on a different
> filegroup than the data table.
> The leaf level is the data, so moot point at best. If you wanted to move
> the data to another file or drive, then I could see where placing
> indexes in a different filegroup would get you there.
> Sorry to waste everyone's time...amazing what you can think of when
> you're playing Collapse!!!

Nah, the question is not really that meaningless. Not as it was posted.
To wit, there is nothing in this world which says that clustered index
of a table must be on the primary key. Sometimes the PK is the best
bet for the clustered indexes, but there are also many cases where it
is not.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

2012年3月7日星期三

First/Last Day of Month (current and previous three months)

Hi,
I want to set a parameter to use the first and last days of the month for
two parameters' defaults. I then want to set the first day of the previous
two months as the "available values" for on of the parameters and the last
day of the previous two months for the other parameter's "available values".
Can anyone tell me why this isn't working (I want to get last day of month):
=DATEADD("dd", - DAY(DATEADD("m", 1, Now)), DATEADD("m", 1, Now))
I have tried using the Today funcion instead of Now with no joy. I started
doing this with DATEADD and DATEDIFF, as is commonly found as the solution
for this on tons of tech articles. However, I have learnt that although
T-SQL can work out what you want to do with DATEADD (which expects DateTime)
and DATEDIFF(which returns an Integer), reporting services cannot. So I
found the above expression that doesn't use DATEDIFF, but I still can't get
it to work. The expression builder doesn't seem to find a problem with the
syntax (no green or red wavy lines), but when I run the report I get the
following:
An error occurred duing local report processing. Error during processing of
'SDate' report parameter.
Please tell me someone has an answer for me. This should be so simple. I
bet I am going to kick myself when (if!!) the answer comes through.
TIA,
JarrydHi,
Well I just did this in T-SQL as part of the procedure that feeds the
report. Created a virtual table and added a second dataset to the report.
That seems to work. One thing I find odd - the "calendar" button can't be
used to set the date properly. We are in the UK and so the calendar
generates a UK style date, but Reportiong Services won't have it; you have
to manually enter it in USA format!! How do you solve it? Please don't
tell me you have to programtically grab the variable and cast it in USA
style. That's just silly. But if so, then where do you do it? I am
assuming you have to go to Dataset>Parameters and jimmy the value field's
value (def: Parameters!My_Param.Value) to grab the value and reorder the
days and months but I can't get it to work. The only other place I know of
is the Report>Report Parameters form, but that doesn't look too promising.
TIA,
Jarryd
"Jarryd" <noemail@.nodomain.com> wrote in message
news:u4I1mEMqHHA.2372@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I want to set a parameter to use the first and last days of the month for
> two parameters' defaults. I then want to set the first day of the
> previous two months as the "available values" for on of the parameters and
> the last day of the previous two months for the other parameter's
> "available values".
> Can anyone tell me why this isn't working (I want to get last day of
> month):
> =DATEADD("dd", - DAY(DATEADD("m", 1, Now)), DATEADD("m", 1, Now))
> I have tried using the Today funcion instead of Now with no joy. I
> started doing this with DATEADD and DATEDIFF, as is commonly found as the
> solution for this on tons of tech articles. However, I have learnt that
> although T-SQL can work out what you want to do with DATEADD (which
> expects DateTime) and DATEDIFF(which returns an Integer), reporting
> services cannot. So I found the above expression that doesn't use
> DATEDIFF, but I still can't get it to work. The expression builder
> doesn't seem to find a problem with the syntax (no green or red wavy
> lines), but when I run the report I get the following:
> An error occurred duing local report processing. Error during processing
> of 'SDate' report parameter.
> Please tell me someone has an answer for me. This should be so simple. I
> bet I am going to kick myself when (if!!) the answer comes through.
> TIA,
> Jarryd
>

First, Last, Middle ??

I have a Matrix that always displays two rows of data.
One row show values from Jan 1 of the current year.
The second row shows values for today.
In the foot I show the % the values have changed so YTD with the following
formula:
=(Last(Fields!Core.Value) - First(Fields!Core.Value)) /
First(Fields!Core.Value) * 100
This works great and looks like this:
Date | Core
--
Jan 1 2005 | $400
Aug 31 2005 | $500
--
Footer +25%
I have been asked to add in the value from a year ago today but still
display the change in value from just Jan 1.
Date | Core
--
Aug 31 2004 | $300
Jan 1 2005 | $400
Aug 31 2005 | $500
--
Footer +25% (Diff between Jan 1 and Aug 31 2005)
How would I calc the % change in the footer. My formula will not work as the
"First" value is a year ago today not Jan 1. Is there a "Middle" function ?
:) :)
Thoughts ?
Thanks in Advance
Pete MitchellTry something like this:
=(Last(Fields!Core.Value) - CDate("1/1/"&CStr(Year(First(Fields!Core.Value)))))
/
CDate("1/1/"&CStr(Year(First(Fields!Core.Value)))) * 100
GeoSynch
"PeteMitchell" <PeteMitchell@.discussions.microsoft.com> wrote in message
news:EE7A94F6-8F3B-46EC-87E3-7DA323C927D0@.microsoft.com...
>I have a Matrix that always displays two rows of data.
> One row show values from Jan 1 of the current year.
> The second row shows values for today.
> In the foot I show the % the values have changed so YTD with the following
> formula:
> =(Last(Fields!Core.Value) - First(Fields!Core.Value)) /
> First(Fields!Core.Value) * 100
> This works great and looks like this:
> Date | Core
> --
> Jan 1 2005 | $400
> Aug 31 2005 | $500
> --
> Footer +25%
> I have been asked to add in the value from a year ago today but still
> display the change in value from just Jan 1.
> Date | Core
> --
> Aug 31 2004 | $300
> Jan 1 2005 | $400
> Aug 31 2005 | $500
> --
> Footer +25% (Diff between Jan 1 and Aug 31 2005)
> How would I calc the % change in the footer. My formula will not work as the
> "First" value is a year ago today not Jan 1. Is there a "Middle" function ?
> :) :)
> Thoughts ?
> Thanks in Advance
> Pete Mitchell|||Actually, it probably shoud be:
=(Last(Fields!Core.Value) - CDate("1/1/"&CStr(Year(Last(Fields!Core.Value)))))
/ CDate("1/1/"&CStr(Year(Last(Fields!Core.Value)))) * 100
GeoSynch
"GeoSynch" <SpamSlayed@.Casablanca.com> wrote in message
news:ecLK3yprFHA.3884@.TK2MSFTNGP11.phx.gbl...
> Try something like this:
> =(Last(Fields!Core.Value) -
> CDate("1/1/"&CStr(Year(First(Fields!Core.Value))))) /
> CDate("1/1/"&CStr(Year(First(Fields!Core.Value)))) * 100
>
> GeoSynch
>
> "PeteMitchell" <PeteMitchell@.discussions.microsoft.com> wrote in message
> news:EE7A94F6-8F3B-46EC-87E3-7DA323C927D0@.microsoft.com...
>>I have a Matrix that always displays two rows of data.
>> One row show values from Jan 1 of the current year.
>> The second row shows values for today.
>> In the foot I show the % the values have changed so YTD with the following
>> formula:
>> =(Last(Fields!Core.Value) - First(Fields!Core.Value)) /
>> First(Fields!Core.Value) * 100
>> This works great and looks like this:
>> Date | Core
>> --
>> Jan 1 2005 | $400
>> Aug 31 2005 | $500
>> --
>> Footer +25%
>> I have been asked to add in the value from a year ago today but still
>> display the change in value from just Jan 1.
>> Date | Core
>> --
>> Aug 31 2004 | $300
>> Jan 1 2005 | $400
>> Aug 31 2005 | $500
>> --
>> Footer +25% (Diff between Jan 1 and Aug 31 2005)
>> How would I calc the % change in the footer. My formula will not work as the
>> "First" value is a year ago today not Jan 1. Is there a "Middle" function ?
>> :) :)
>> Thoughts ?
>> Thanks in Advance
>> Pete Mitchell
>|||Thanks a bunch.
How does that work ?
There are two fields in play here : Date and Core
How is that get the Core.value when the Date.value = Jan 1 2005 ?
Pete
"GeoSynch" wrote:
> Actually, it probably shoud be:
> =(Last(Fields!Core.Value) - CDate("1/1/"&CStr(Year(Last(Fields!Core.Value)))))
> / CDate("1/1/"&CStr(Year(Last(Fields!Core.Value)))) * 100
>
> GeoSynch
>
> "GeoSynch" <SpamSlayed@.Casablanca.com> wrote in message
> news:ecLK3yprFHA.3884@.TK2MSFTNGP11.phx.gbl...
> > Try something like this:
> > =(Last(Fields!Core.Value) -
> > CDate("1/1/"&CStr(Year(First(Fields!Core.Value))))) /
> > CDate("1/1/"&CStr(Year(First(Fields!Core.Value)))) * 100
> >
> >
> > GeoSynch
> >
> >
> > "PeteMitchell" <PeteMitchell@.discussions.microsoft.com> wrote in message
> > news:EE7A94F6-8F3B-46EC-87E3-7DA323C927D0@.microsoft.com...
> >>I have a Matrix that always displays two rows of data.
> >> One row show values from Jan 1 of the current year.
> >> The second row shows values for today.
> >>
> >> In the foot I show the % the values have changed so YTD with the following
> >> formula:
> >>
> >> =(Last(Fields!Core.Value) - First(Fields!Core.Value)) /
> >> First(Fields!Core.Value) * 100
> >>
> >> This works great and looks like this:
> >> Date | Core
> >> --
> >> Jan 1 2005 | $400
> >> Aug 31 2005 | $500
> >> --
> >> Footer +25%
> >>
> >> I have been asked to add in the value from a year ago today but still
> >> display the change in value from just Jan 1.
> >>
> >> Date | Core
> >> --
> >> Aug 31 2004 | $300
> >> Jan 1 2005 | $400
> >> Aug 31 2005 | $500
> >> --
> >> Footer +25% (Diff between Jan 1 and Aug 31 2005)
> >>
> >> How would I calc the % change in the footer. My formula will not work as the
> >> "First" value is a year ago today not Jan 1. Is there a "Middle" function ?
> >> :) :)
> >>
> >> Thoughts ?
> >>
> >> Thanks in Advance
> >>
> >> Pete Mitchell
> >
> >
>
>|||CDate("1/1/"&CStr(Year(Last(Fields!Core.Value)))) evaluates thusly:
Last(Fields!Core.Value) = '08/31/2005' data type Date
Year(Last(Fields!Core.Value)) = '2005' data type Integer
CStr(Year(Last(Fields!Core.Value))) converts it to a string value
so that when concatenated with "1/1/" it will evaluate to string value
"1/1/2005"
CDate converts it back to an actual date value of '01/01/2005'
GeoSynch
"PeteMitchell" <PeteMitchell@.discussions.microsoft.com> wrote in message
news:940A01C6-D8A5-4C44-8BA4-3AF232AD790F@.microsoft.com...
> Thanks a bunch.
> How does that work ?
> There are two fields in play here : Date and Core
> How is that get the Core.value when the Date.value = Jan 1 2005 ?
> Pete
>
> "GeoSynch" wrote:
>> Actually, it probably shoud be:
>> =(Last(Fields!Core.Value) -
>> CDate("1/1/"&CStr(Year(Last(Fields!Core.Value)))))
>> / CDate("1/1/"&CStr(Year(Last(Fields!Core.Value)))) * 100
>>
>> GeoSynch
>>
>> "GeoSynch" <SpamSlayed@.Casablanca.com> wrote in message
>> news:ecLK3yprFHA.3884@.TK2MSFTNGP11.phx.gbl...
>> > Try something like this:
>> > =(Last(Fields!Core.Value) -
>> > CDate("1/1/"&CStr(Year(First(Fields!Core.Value))))) /
>> > CDate("1/1/"&CStr(Year(First(Fields!Core.Value)))) * 100
>> >
>> >
>> > GeoSynch
>> >
>> >
>> > "PeteMitchell" <PeteMitchell@.discussions.microsoft.com> wrote in message
>> > news:EE7A94F6-8F3B-46EC-87E3-7DA323C927D0@.microsoft.com...
>> >>I have a Matrix that always displays two rows of data.
>> >> One row show values from Jan 1 of the current year.
>> >> The second row shows values for today.
>> >>
>> >> In the foot I show the % the values have changed so YTD with the following
>> >> formula:
>> >>
>> >> =(Last(Fields!Core.Value) - First(Fields!Core.Value)) /
>> >> First(Fields!Core.Value) * 100
>> >>
>> >> This works great and looks like this:
>> >> Date | Core
>> >> --
>> >> Jan 1 2005 | $400
>> >> Aug 31 2005 | $500
>> >> --
>> >> Footer +25%
>> >>
>> >> I have been asked to add in the value from a year ago today but still
>> >> display the change in value from just Jan 1.
>> >>
>> >> Date | Core
>> >> --
>> >> Aug 31 2004 | $300
>> >> Jan 1 2005 | $400
>> >> Aug 31 2005 | $500
>> >> --
>> >> Footer +25% (Diff between Jan 1 and Aug 31 2005)
>> >>
>> >> How would I calc the % change in the footer. My formula will not work as
>> >> the
>> >> "First" value is a year ago today not Jan 1. Is there a "Middle" function
>> >> ?
>> >> :) :)
>> >>
>> >> Thoughts ?
>> >>
>> >> Thanks in Advance
>> >>
>> >> Pete Mitchell
>> >
>> >
>>

First, Last, Again

I have a Matrix that always displays two rows of data.
One row show values from Jan 1 of the current year.
The second row shows values for today.
In the foot I show the % the values have changed so YTD with the following
formula:
=(Last(Fields!Core.Value) - First(Fields!Core.Value)) /
First(Fields!Core.Value) * 100
This works great and looks like this:
Date | Core
--
Jan 1 2005 | $400
Aug 31 2005 | $500
--
Footer +25%
I have been asked to add in the value from a year ago today but still
display the change in value from just Jan 1.
Date | Core
--
Aug 31 2004 | $300
Jan 1 2005 | $400
Aug 31 2005 | $500
--
Footer +25% (Diff between Jan 1 and Aug 31 2005)
How would I calc the % change in the footer. My formula will not work as the
"First" value is a year ago today not Jan 1. Is there a "Middle" function ?
:) :)
Thoughts ?
Thanks in Advance
Pete Mitchellmaybe you could use groups to accomplish the division of the first row from
the other two. Then you could just hide the group header and footer of
group1 and hide the header of group 2. I am not sure how the first and last
will work with groups ... just a thought
> Date | Core
> --
> Aug 31 2004 | $300 ======== > group 1
> Jan 1 2005 | $400 ========> group 2
> Aug 31 2005 | $500 ========> group 2
> --
> Footer +25% (Diff between Jan 1 and Aug 31 2005)
"PeteMitchell" wrote:
> I have a Matrix that always displays two rows of data.
> One row show values from Jan 1 of the current year.
> The second row shows values for today.
> In the foot I show the % the values have changed so YTD with the following
> formula:
> =(Last(Fields!Core.Value) - First(Fields!Core.Value)) /
> First(Fields!Core.Value) * 100
> This works great and looks like this:
> Date | Core
> --
> Jan 1 2005 | $400
> Aug 31 2005 | $500
> --
> Footer +25%
> I have been asked to add in the value from a year ago today but still
> display the change in value from just Jan 1.
> Date | Core
> --
> Aug 31 2004 | $300
> Jan 1 2005 | $400
> Aug 31 2005 | $500
> --
> Footer +25% (Diff between Jan 1 and Aug 31 2005)
> How would I calc the % change in the footer. My formula will not work as the
> "First" value is a year ago today not Jan 1. Is there a "Middle" function ?
> :) :)
> Thoughts ?
> Thanks in Advance
> Pete Mitchell
>|||Thanks, good suggestion.
"MJ Taft" wrote:
> maybe you could use groups to accomplish the division of the first row from
> the other two. Then you could just hide the group header and footer of
> group1 and hide the header of group 2. I am not sure how the first and last
> will work with groups ... just a thought
> > Date | Core
> > --
> > Aug 31 2004 | $300 ======== > group 1
> > Jan 1 2005 | $400 ========> group 2
> > Aug 31 2005 | $500 ========> group 2
> > --
> > Footer +25% (Diff between Jan 1 and Aug 31 2005)
>
> "PeteMitchell" wrote:
> > I have a Matrix that always displays two rows of data.
> > One row show values from Jan 1 of the current year.
> > The second row shows values for today.
> >
> > In the foot I show the % the values have changed so YTD with the following
> > formula:
> >
> > =(Last(Fields!Core.Value) - First(Fields!Core.Value)) /
> > First(Fields!Core.Value) * 100
> >
> > This works great and looks like this:
> > Date | Core
> > --
> > Jan 1 2005 | $400
> > Aug 31 2005 | $500
> > --
> > Footer +25%
> >
> > I have been asked to add in the value from a year ago today but still
> > display the change in value from just Jan 1.
> >
> > Date | Core
> > --
> > Aug 31 2004 | $300
> > Jan 1 2005 | $400
> > Aug 31 2005 | $500
> > --
> > Footer +25% (Diff between Jan 1 and Aug 31 2005)
> >
> > How would I calc the % change in the footer. My formula will not work as the
> > "First" value is a year ago today not Jan 1. Is there a "Middle" function ?
> > :) :)
> >
> > Thoughts ?
> >
> > Thanks in Advance
> >
> > Pete Mitchell
> >

First SQL2K5 server install performance issues

This is comparing performance between two machines...the first is our
current SQL2000 server
Dual 3Ghz Xeons on dual channel scsi drives.
New machine
Dual 3.6Ghz 64-bit Xeons dual channel scsi
SCSI controller in each box is identical as is the drive configuration and
file placement.
I know this may not be a very clear view of the performance but I certainly
expected more from the new server.
We have a table tblMLOS which contains 392468 rows. This following script
after repeated executions runs consistently at 9 seconds on the old server
and 15-17 seconds on the new 64-bit machine. Are we missing something here?
This just doesn't seem right.
The table structure is very simple:
create table tblMLOS
(
lngID int,
lngSponsor int,
lngSponsor2 int,
lngSponsor3 int,
strSponsorType varchar(20)
)
---
declare @.lngCount int
declare @.lngID int
declare curID cursor for
select lngID from tblmlos
set @.lngCount=0
open curID
fetch next from curID into @.lngID
while @.@.fetch_status=0 begin
set @.lngCount=@.lngCount+1
fetch next from curID into @.lngID
end
close curID
deallocate curID
select @.lngCount64 bit will not always be quicker, your code will be purely CPU bound , and
probably only use 1 cpu, the difference in CPU is not much.
Not sure why you are not just doing
select count(1) from lngID from tblmlos
This probably will be quicker.
--
Simon Sabin
SQL Server MVP
http://sqljunkies.com/weblog/simons
"Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
news:eFa%23wF%23YGHA.3400@.TK2MSFTNGP02.phx.gbl...
> This is comparing performance between two machines...the first is our
> current SQL2000 server
> Dual 3Ghz Xeons on dual channel scsi drives.
> New machine
> Dual 3.6Ghz 64-bit Xeons dual channel scsi
> SCSI controller in each box is identical as is the drive configuration and
> file placement.
> I know this may not be a very clear view of the performance but I
> certainly expected more from the new server.
> We have a table tblMLOS which contains 392468 rows. This following script
> after repeated executions runs consistently at 9 seconds on the old server
> and 15-17 seconds on the new 64-bit machine. Are we missing something
> here? This just doesn't seem right.
> The table structure is very simple:
> create table tblMLOS
> (
> lngID int,
> lngSponsor int,
> lngSponsor2 int,
> lngSponsor3 int,
> strSponsorType varchar(20)
> )
> ---
> declare @.lngCount int
> declare @.lngID int
> declare curID cursor for
> select lngID from tblmlos
> set @.lngCount=0
> open curID
> fetch next from curID into @.lngID
> while @.@.fetch_status=0 begin
> set @.lngCount=@.lngCount+1
> fetch next from curID into @.lngID
> end
> close curID
> deallocate curID
> select @.lngCount
>
>|||This is not a production query. Just one of the many things we are trying
to see if there is any performance increase at all. So far every thing
we've tried is slower on the SQL 2005 box. I just picked this one cause it
is easy and straightforward.
"Simon Sabin" <SimonSabin@.noemal.noemail> wrote in message
news:Or6gZQ$YGHA.5004@.TK2MSFTNGP02.phx.gbl...
> 64 bit will not always be quicker, your code will be purely CPU bound ,
> and probably only use 1 cpu, the difference in CPU is not much.
> Not sure why you are not just doing
> select count(1) from lngID from tblmlos
> This probably will be quicker.
> --
> Simon Sabin
> SQL Server MVP
> http://sqljunkies.com/weblog/simons
> "Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
> news:eFa%23wF%23YGHA.3400@.TK2MSFTNGP02.phx.gbl...
>> This is comparing performance between two machines...the first is our
>> current SQL2000 server
>> Dual 3Ghz Xeons on dual channel scsi drives.
>> New machine
>> Dual 3.6Ghz 64-bit Xeons dual channel scsi
>> SCSI controller in each box is identical as is the drive configuration
>> and file placement.
>> I know this may not be a very clear view of the performance but I
>> certainly expected more from the new server.
>> We have a table tblMLOS which contains 392468 rows. This following
>> script after repeated executions runs consistently at 9 seconds on the
>> old server and 15-17 seconds on the new 64-bit machine. Are we missing
>> something here? This just doesn't seem right.
>> The table structure is very simple:
>> create table tblMLOS
>> (
>> lngID int,
>> lngSponsor int,
>> lngSponsor2 int,
>> lngSponsor3 int,
>> strSponsorType varchar(20)
>> )
>> ---
>> declare @.lngCount int
>> declare @.lngID int
>> declare curID cursor for
>> select lngID from tblmlos
>> set @.lngCount=0
>> open curID
>> fetch next from curID into @.lngID
>> while @.@.fetch_status=0 begin
>> set @.lngCount=@.lngCount+1
>> fetch next from curID into @.lngID
>> end
>> close curID
>> deallocate curID
>> select @.lngCount
>>
>|||I do see in the execution plan between the 2k and 2k5 that the 2k5 is doing
a Clustered Index Insert at every fetch and then a Clustered Index Scan
where as the 2k box is just doing the Scan. The lngID column is a clustered
index and the indexes on the 2k5 box have all been rebuilt with fullscan.
"Simon Sabin" <SimonSabin@.noemal.noemail> wrote in message
news:Or6gZQ$YGHA.5004@.TK2MSFTNGP02.phx.gbl...
> 64 bit will not always be quicker, your code will be purely CPU bound ,
> and probably only use 1 cpu, the difference in CPU is not much.
> Not sure why you are not just doing
> select count(1) from lngID from tblmlos
> This probably will be quicker.
> --
> Simon Sabin
> SQL Server MVP
> http://sqljunkies.com/weblog/simons
> "Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
> news:eFa%23wF%23YGHA.3400@.TK2MSFTNGP02.phx.gbl...
>> This is comparing performance between two machines...the first is our
>> current SQL2000 server
>> Dual 3Ghz Xeons on dual channel scsi drives.
>> New machine
>> Dual 3.6Ghz 64-bit Xeons dual channel scsi
>> SCSI controller in each box is identical as is the drive configuration
>> and file placement.
>> I know this may not be a very clear view of the performance but I
>> certainly expected more from the new server.
>> We have a table tblMLOS which contains 392468 rows. This following
>> script after repeated executions runs consistently at 9 seconds on the
>> old server and 15-17 seconds on the new 64-bit machine. Are we missing
>> something here? This just doesn't seem right.
>> The table structure is very simple:
>> create table tblMLOS
>> (
>> lngID int,
>> lngSponsor int,
>> lngSponsor2 int,
>> lngSponsor3 int,
>> strSponsorType varchar(20)
>> )
>> ---
>> declare @.lngCount int
>> declare @.lngID int
>> declare curID cursor for
>> select lngID from tblmlos
>> set @.lngCount=0
>> open curID
>> fetch next from curID into @.lngID
>> while @.@.fetch_status=0 begin
>> set @.lngCount=@.lngCount+1
>> fetch next from curID into @.lngID
>> end
>> close curID
>> deallocate curID
>> select @.lngCount
>>
>