Viewing 15 posts - 7,021 through 7,035 (of 7,631 total)
Just add an "ORDER BY Student, AttendDate" to the end of Jason's (Joel's?) query.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 10:44 pm
Oops, wait a minute, I am getting my threads mixed up... Never mind.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 10:24 pm
Actually, Jeff, it's not that different from what I am already doing, except that it is dependent on an Index that may not exist.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 10:20 pm
The query that I posted above has been doing pretty well. I'm testing it on a 3-million row table with substantial column width (sysobjects plus about 200 more bytes)...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 8:51 pm
My random and ad-hoc tests leads me to believe that this is about as good as you can do
Create Proc spTableRows_Window(@startingRow int, @rows int)
AS
--NOTE: some stuff stolen from Jeff...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 7:01 pm
Jason Selburg (4/30/2008)
Sorry RBarry, but this is the SQL 2000 forum. ROW_NUMBER() isn't supported in 2000.
Rats! I forgot to check, sorry.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 6:10 pm
OK, no answers yet, but this is what I have come up with:
--====== Load up the working table
SELECT b.Record_No
, b.Item
, b.PlnQty
, Rank()...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 6:08 pm
Also, this bit here:
...
SELECT @@fetch_status
WHILE @@fetch_status = 0
BEGIN
IF @ChkItem <> @CumItem
BEGIN
Set @ChkItem = @CumItem
Set @mCid =...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 4:58 pm
Please put your data into a form that we can use for tests (like INSERT statements). Here is a link that explains this:http://www.sqlservercentral.com/articles/Best+Practices/61537/
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 4:35 pm
Something like this:
Select *, row_number() Over(Partition by StudentID Order by EntryDate)
From Students
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 4:22 pm
one of the [font="system"]ex.cal_date[/font] column values in the database that fails has probably been set to zero or possibly NULL.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 4:06 pm
Lynn (4/30/2008)
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 3:49 pm
Some of the record sequences look very suspicious to me. In particular, I would check out the records with IDs: 7622 and 9012. Especially the second one (9012)...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 3:39 pm
Frankly, this looks like someone is running manual tests on your table and then rolling-back or deleting the records.
Look for DELETES or ROLLBACKS in the log file. Also, if...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 3:34 pm
ygulas (4/30/2008)
insert into PROD.DB.dbo.tablex
select * from DEV.DB.dbo.tablex
( DEV is the name of...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 3:14 pm
Viewing 15 posts - 7,021 through 7,035 (of 7,631 total)