Ngn x?p trn x?y ra khi b?n ch?y m?t truy v?n c ch?a m?t s? l?n cc ?i s? bn trong m?t IN ho?c m?t i?u kho?n khng IN trong SQL Server

D?ch tiu ? D?ch tiu ?
ID c?a bi: 288095 - Xem s?n ph?m m bi ny p d?ng vo.
BUG #: 235727 (shiloh_bugs)
BUG #: 58274 (sqlbug_70)
Bung t?t c? | Thu g?n t?t c?

TRI?U CH?NG

Truy v?n c ch?a m?t s? l?n cc ?i s? (hng ngn) bn trong m?t IN ho?c m?t i?u kho?n khng IN c th? t?o ra m?t ngn x?p trn. V d?, truy v?n sau y k?t qu? trong m?t ngn x?p trn:
SELECT max(au_id) FROM authors WHERE au_id IN(1,2,5,......,11571)  
-- Query contains over 11570 arguments.
				
Nh?t k? l?i SQL Server ch?a thng tin tng t? nh sau khi trn ngn x?p x?y ra:
2000-08-10 12:02:37.87 spid51    08/10/00 12:02:37 Stack Overflow Dump not possible - Exception c00000fd E at 0x00587286
2000-08-10 12:02:37.87 spid51    Address=587286 Exception Code = c00000fd
2000-08-10 12:02:37.87 spid51    eax=195922d0 ebx=19592338 ecx=2ad0e938 edx=00000007
2000-08-10 12:02:37.87 spid51    esi=196ce2c8 edi=19592180 eip=00587286 esp=2ac93000
2000-08-10 12:02:37.87 spid51    ebp=2ac93028 efl=00010202
2000-08-10 12:02:37.87 spid51    cs=1b ss=23 ds=23 es=23 fs=38 gs=0
2000-08-10 12:02:37.87 spid51    1: Return Address 00587286
2000-08-10 12:02:37.87 spid51    2: Return Address 0058728B.................
				
Trong m?t s? tr?ng h?p, SQL Server c th? th?c s? t?t my nh l k?t qu? c?a ngn x?p trn.

CCH GI?I QUY?T KHC

Vi?t l?i cc truy v?n v s? d?ng m?t b?ng #temp c ch?a cc gi tr? trong danh sch IN thay v? s? d?ng m?t m?nh ? IN. V d?, truy v?n tr?c c th? ?c re-written nh th? ny:
CREATE TABLE #IN_values (au_id char(4))
INSERT INTO #IN_values select au_id FROM Table_with_values_123456789...

SELECT max(au_id)
FROM authors as A
JOIN #IN_values as I ON (A.au_id = I.au_id)
				

T?NH TR?NG

Microsoft ? xc nh?n r?ng y l m?t v?n ? trong cc s?n ph?m c?a Microsoft ?c li?t k ? ?u c?a bi vi?t ny.

THNG TIN THM

Khch hng khng ng?t k?t n?i, nhng thng bo l?i ny c th? x?y ra:
My ch?: Msg 8621, t?ng 17, bang 1, ?ng 2 Truy v?n b? x? l? l?i bn trong: B? vi x? l? truy v?n ch?y khng gian ngn x?p trong t?i u ha truy v?n.

Thu?c tnh

ID c?a bi: 288095 - L?n xem xt sau cng: 23 Thang Tam 2011 - Xem xt l?i: 2.0
p d?ng
  • Microsoft SQL Server 7.0 Standard Edition
  • Microsoft SQL Server 2000 Enterprise Edition
  • Microsoft SQL Server 2000 Personal Edition
  • Microsoft SQL Server 2000 Developer Edition
  • Microsoft SQL Server 2000 Standard Edition
T? kha:
kbprb kbpending kbmt KB288095 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:288095

Cung cp Phan hi

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com