I have a stored procedure querying a Sybase database. The SQL is :
SELECT tblLDAP.UserAutoId, tblLDAP.FirstName, tblLDAP.LastName
FROM (tblContacts INNER JOIN tblLDAP ON tblContacts.UserId = tblLDAP.UserAutoId)
INNER JOIN LDAP_CAD_Buildings ON tblLDAP.Building = LDAP_CAD_Buildings.Building
WHERE LDAP_CAD_Buildings.Arena_id = @strRegion
GROUP BY tblLDAP.UserAutoId, tblLDAP.FirstName, tblLDAP.LastName
ORDER BY tblLDAP.LastName
Just recently it is generating the following error:
Sybase ADO Provider error '80004005'
[Native Error code: 414] [DataDirect ADO Sybase Provider] The current query would generate a key size of 765 for a work table. This exceeds the maximum allowable limit of 600.
The query works in a blink in both SQL Server and Access, but not in Sybase. All that has changed recently is that there has been an increase in records in the table tblLDAP from 32,000 records to 72,000. This would not have affected the output of the recordset which is dependant on tblContacts. tblContacts holds 534 records and LDAP_CAD_Buildings has 256 records.
The SQL produces a recordset of only 60 records
If I remove the aggregation the procedure will work.
What is causing this problem in Sybase and how do I correct it?