Thursday, March 22, 2012
download location
We'd like to get access to Reporting Services for SQL2k. Where can I
download? (all i can find is the download to the trial)Did you get any response on this
I'm in the same boat, I can find the Service Packs, but I can't find the
base software.
Any direction will be much appreciated.
"john doe" wrote:
> We own SQL 2000 Std server license.
> We'd like to get access to Reporting Services for SQL2k. Where can I
> download? (all i can find is the download to the trial)
>
>
Sunday, March 11, 2012
Double summation
Loc East N
CA 100 3
CA 103 5
CA 109 2
CA 110 3
I'm interested in the total of N on either side of the largest gap in
Eastings.
In this case the largest gap is 6 (between 103 and 109), and the sum of
N for the 2 rows below the gap is 8, and for the 2 above the gap it's
5.
The problem is to locate the largest gap, and compute the sum of N for
the cases on either side. There are multiple locations, multiple
Eastings
per location, but only one largest gap. (If there are two largest
gaps, it
does't matter which one is used for the sums.)
I can do this with multiple passes -- first locate the largest gap,
then go
back and locate the Eastings on either side, then sum up the Ns.
That's
realy clumsy, I can't figure out how to do it more quickly, and I'm not
sure
what I'm doing is right. Any help would be appreciated.
Thanks,
Jim GeissmanJim,
CREATE TABLE a(Loc CHAR(2), East INT, N INT)
go
INSERT a VALUES('CA', 100, 3)
INSERT a VALUES('CA', 103, 5)
INSERT a VALUES('CA', 109, 2)
INSERT a VALUES('CA', 110, 3)
INSERT a VALUES('OR', 100, 3)
INSERT a VALUES('OR', 108, 5)
INSERT a VALUES('OR', 109, 2)
INSERT a VALUES('OR', 110, 3)
INSERT a VALUES('WA', 108, 5)
INSERT a VALUES('WA', 109, 2)
INSERT a VALUES('WA', 110, 3)
INSERT a VALUES('WA', 115, 3)
SELECT * FROM(
SELECT Loc, East,
(SELECT SUM(n) FROM a a1 WHERE a.loc = a1.Loc AND a1.East <= a.East)
BeforeGap,
(SELECT SUM(n) FROM a a1 WHERE a.loc = a1.Loc AND a1.East a.East)
AfterGap,
(SELECT MIN(East) FROM a a1 WHERE a.loc = a1.Loc AND a1.East a.East)
- East GapSize,
ROW_NUMBER() OVER(PARTITION BY Loc ORDER BY ((SELECT MIN(East) FROM a
a1 WHERE a.loc = a1.Loc AND a1.East a.East) - East) DESC) rn
FROM a
) t
WHERE rn=1
SELECT * FROM(
SELECT Loc, East,
(SELECT SUM(n) FROM a a1 WHERE a.loc = a1.Loc AND a1.East <= a.East)
BeforeGap,
(SELECT SUM(n) FROM a a1 WHERE a.loc = a1.Loc AND a1.East a.East)
AfterGap,
(SELECT MIN(East) FROM a a1 WHERE a.loc = a1.Loc AND a1.East a.East)
- East GapSize,
ROW_NUMBER() OVER(PARTITION BY Loc ORDER BY ((SELECT MIN(East) FROM a
a1 WHERE a.loc = a1.Loc AND a1.East a.East) - East) DESC) rn
FROM a
) t
WHERE rn=1
Loc East BeforeGap AfterGap GapSize rn
-- ---- ---- ---- ----
-------
CA 103 8 5 6 1
OR 100 3 10 8 1
WA 110 10 3 5 1
(3 row(s) affected)
--------
Alex Kuznetsov
http://sqlserver-tips.blogspot.com/
http://sqlserver-puzzles.blogspot.com/|||Thank you very much, Alex. That's tremendous.
I learned three new things -- row_number, over and partition.
No wonder I was having trouble.
Thanks again,
Jim
Quote:
Originally Posted by
--------
Alex Kuznetsov
http://sqlserver-tips.blogspot.com/
http://sqlserver-puzzles.blogspot.com/
Friday, February 24, 2012
Domain not show select user location dialog
to add a user to a database the only location I can select from is the
local machine. The machine is part of a SBS domain and I want a
domain user to rights through NT authentication. How do I get the
domain so show up in the list of locations?The SQL Server Services need to be started with a domain account that has
rights to be able to browse the directory. My guess is that you've got the
services started up as system or local accounts.
"Van" wrote:
> I have a laptop with SQL Server 2005 Express installed and when I want
> to add a user to a database the only location I can select from is the
> local machine. The machine is part of a SBS domain and I want a
> domain user to rights through NT authentication. How do I get the
> domain so show up in the list of locations?
>