Unix Technical Forum

BUG

This is a discussion on BUG within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Why does this crash SQL7 with SP4 and latest MDAC? CREATE TABLE #test ( [year] smallint, [month] tinyint, [product] ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 09:15 PM
Lisa Pearlson
 
Posts: n/a
Default BUG

Why does this crash SQL7 with SP4 and latest MDAC?

CREATE TABLE #test (
[year] smallint,
[month] tinyint,
[product] varchar(100),
[value] money
)
GO

INSERT INTO #test VALUES (2000, 2, 'p-01', 1.00)
INSERT INTO #test VALUES (2000, 2, 'p-02', 2.00)
INSERT INTO #test VALUES (2001, 2, 'p-01', 1.00)
INSERT INTO #test VALUES (2001, 2, 'p-03', 3.00)
INSERT INTO #test VALUES (2002, 2, 'p-01', 1.00)
INSERT INTO #test VALUES (2002, 2, 'p-01', 1.00)
GO

SELECT
a.year,
a.product,
a.month,
ISNULL(o.value, 0) value,
ISNULL((SELECT SUM(value) FROM #test
WHERE year=a.year AND product=a.product AND month<=a.month), 0)
cumul_artikel,
ISNULL((SELECT SUM(value) FROM #test
WHERE year=a.year AND month=a.month), 0) value_month,
ISNULL((SELECT SUM(value) FROM #test
WHERE year=a.year AND month<=a.month), 0) cumul_month
FROM (SELECT
j.year,
j.product,
m.month
FROM
(SELECT DISTINCT [year], [product] FROM #test) j,
(SELECT 1 AS [month]
UNION ALL SELECT 2
UNION ALL SELECT 3
UNION ALL SELECT 4
UNION ALL SELECT 5
UNION ALL SELECT 6
UNION ALL SELECT 7
UNION ALL SELECT 8
UNION ALL SELECT 9
UNION ALL SELECT 10
UNION ALL SELECT 11
UNION ALL SELECT 12) m) AS a
LEFT OUTER JOIN #test o
ON o.year = a.year AND o.month=a.month AND o.product=a.product
GO

DROP TABLE #test
GO


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 09:15 PM
 
Posts: n/a
Default BUG

Work's fine on my SQL2000 & Query analizer
Any errors messages? How do you run the code?
Maybe the string is too long?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 09:15 PM
Lisa Pearlson
 
Posts: n/a
Default Re: BUG

Yes, it does work on SQL2000, but crashes SQL7.
And I need it to run on SQL7

<anonymous@discussions.microsoft.com> wrote in message
news:577f01c480e8$49111200$a401280a@phx.gbl...
> Work's fine on my SQL2000 & Query analizer
> Any errors messages? How do you run the code?
> Maybe the string is too long?



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 09:15 PM
Sue Hoegemeier
 
Posts: n/a
Default Re: BUG

Could you please post the error numbers and error messages
you get when you run this? Could you also post any
additional errors you have in the SQL log when you run this?

-Sue

On Fri, 13 Aug 2004 05:56:16 +0200, "Lisa Pearlson"
<no@spam.plz> wrote:

>Yes, it does work on SQL2000, but crashes SQL7.
>And I need it to run on SQL7
>
><anonymous@discussions.microsoft.com> wrote in message
>news:577f01c480e8$49111200$a401280a@phx.gbl...
>> Work's fine on my SQL2000 & Query analizer
>> Any errors messages? How do you run the code?
>> Maybe the string is too long?

>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:21 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com