m00n: moon (Default)
m00n ([personal profile] m00n) wrote2007-02-21 10:46 am
Entry tags:

Nothin' beats nothin'

Gotta love vague and mysterious error messages.

Take MS SQL Server, for instance. I'm writing a query, and it passes the syntax check just fine. Execute the query and you get:

Server: Msg 8624, Level 16, State 21, Line 1
Internal SQL Server error.


So I go to look up more info on that error message number, and the help documentation says:

8624 - Internal SQL Server error.


How helpful.

Any SQL gurus out there? The concept of the query isn't all that complex or challenging - I'm just having a problem coming up with the actual SQL to get what I want.
ext_167746: Slice of the City (Default)

[identity profile] theslice.livejournal.com 2007-02-21 05:26 pm (UTC)(link)
According to Microsoft, this is an issue with SQL Server 2000 when you when it compiles a delete query that contains sub-queries that use "NOT IN" *or* you have a SELECT statement on a view that has many subqueries. Apparently, Service Pack 4 fixes it. They also claim you can try to add the OPTION (MAXDOP 1) query hint onto your query (if it's the DELETE).

http://support.microsoft.com/default.aspx/kb/885442
http://support.microsoft.com/?kbid=830466

Here's another potentially useful discussion:

http://www.tek-tips.com/viewthread.cfm?qid=1159898&page=1

Hope this helps.

[identity profile] akaashben.livejournal.com 2007-02-21 05:52 pm (UTC)(link)
You rock!

That discussion thread at tek-tips lead me to a MS article with a workaround that appears to be working.

I had a MAX() expression in a subquery that was part of my overall select statement, and that seems to be what was causing the error.

The query is now humming away - hopefully it will return without error and without running all day. LOL!

Thanks!
ext_167746: Slice of the City (Default)

[identity profile] theslice.livejournal.com 2007-02-21 07:24 pm (UTC)(link)
Ah, jolly good. Glad that worked out!