FIX: ???? ?????? ?? ?????? ???? ??????? ??? ???? ??? ?????? ? ???? ?????? ????? ?????

?????? ????????? ?????? ?????????
???? ???????: 318530 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???: 356418 (SHILOH_BUGS)
????? ???? | ?? ????

?? ??? ??????

???????

?? ???? ????? ??????? ???? ????? ??? ???? ??? ????? ??? ?????? ????? ???? ???? ????? ?? ????? WHERE ??? ??????? ???????? ?? ??? ?????? (??? ???? ??????? ??? ????? ??? ?????? ?????? ??? ?????? ???? ?? ?????? ?????? ?? ??? ?????? ????) SQL Server ?? ?????? ?????? ?????? ??? ????? ????? ?? ????? ??? ?????? ?????? ???? ???? ??????? ??????. ??? ???? ???? ???? ??????? ?? ??? ?????? ??? ?????? ???? ?????? ????????? ? ?? ???? ????? ?? ?????? ???????? ?? ????? ???:
  • ????? ????? ???????? ????.
  • ?????? ???? ?? ??????? ??????? ?????? SQL Server.
  • ??? ??????? ???? ?????????.

????

??? ?? SQL Server 2005

??? ??? ???????? ??? ?????? ??? ???? ???? ???? ?? SQL Server 2005. ????? ?? ?????????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
913089????? ?????? ??? ???? ???? ???? ?? SQL Server 2005
??? ????? ???? ???? SQL Server 2005 ??? ????? ????? ???? 4101 ??? ??? ???????.

??? ?? SQL Server 2000

??? ??? ???????? ??? ?????? ??? ???? ???? ???? ?? Microsoft SQL Server 2000. ????? ?? ?????????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
290211????? ?????? ??? ???? ???? ???? ?? SQL Server 2000
??????: ?? ?????? ?? ??????? ?????? ?????? ??? ????? Microsoft SQL Server 2000 Service Pack 3.

??? ?? ???? ?????? ?????????? ?? ??? ??????? ???? ??????? ??????? ?? ????:
   Version       File name
   -----------------------------

   8.00.0584     Sqlservr.exe
				
??????: ???? ?????? ?????? ???? ????? ???? ?? ?????? ???? ????? ??? ??????? ?? ????? ????? ??? ????? ??????.

?????

???? ?? SQL Server 2005

???? Microsoft ?? ??? ????? ?? ?????? Microsoft ??????? ?? ??? "????? ???".
?? ????? ??? ??????? ???? ??? ?? Microsoft SQL Server 2005 ?????? ????? ?????? Service Pack 1.

???? ?? SQL Server 2000

???? Microsoft ?? ??? ????? ?? ?????? Microsoft ??????? ?? ??? "????? ???".
?? ????? ??? ??????? ???? ??? ?? Microsoft SQL Server 2000 Service Pack 3.

??????? ????

????????? ????? contrived ?????? ?????? ????? ?????? pubs (????????) ??? ??? ?????????:
set ansi_nulls off
go

use pubs
go

create procedure dbo.ansi_nulls_param @P1 varchar(11) as
select t.title_id, a.au_id, ta.title_id, s.stor_id from titles t 
   left outer join titleauthor ta on ta.title_id = t.title_id
   inner join authors a on a.au_id = t.title_id
   inner join sales s on s.title_id = t.title_id
where ta.title_id = @P1
go

exec dbo.ansi_nulls_param '123-45-6789'
go

drop proc dbo.ansi_nulls_param
go

--Slower Query Plan:
       |--Filter(WHERE:([ta].[title_id]=[@P1]))
            |--Nested Loops(Left Outer Join, OUTER REFERENCES:([t].[title_id]))
                 |--Nested Loops(Inner Join, OUTER REFERENCES:([s].[title_id]))
                 |    |--Nested Loops(Inner Join, OUTER REFERENCES:([s].[title_id]))
                 |    |    |--Index Scan(OBJECT:([pubs].[dbo].[sales].[titleidind] AS [s]))
                 |    |    |--Clustered Index Seek(OBJECT:([pubs].[dbo].[authors].[UPKCL_auidind] AS [a]), SEEK:([a].[au_id]=[s].[title_id]) ORDERED FORWARD)
                 |    |--Clustered Index Seek(OBJECT:([pubs].[dbo].[titles].[UPKCL_titleidind] AS [t]), SEEK:([t].[title_id]=[s].[title_id]) ORDERED FORWARD)
                 |--Index Seek(OBJECT:([pubs].[dbo].[titleauthor].[titleidind] AS [ta]), SEEK:([ta].[title_id]=[t].[title_id]) ORDERED FORWARD)

--Faster Query Plan:
       |--Nested Loops(Inner Join, OUTER REFERENCES:([a].[au_id]))
            |--Nested Loops(Inner Join, OUTER REFERENCES:([t].[title_id]))
            |    |--Filter(WHERE:([ta].[title_id]=[@P1]))
            |    |    |--Nested Loops(Left Outer Join, OUTER REFERENCES:([t].[title_id]))
            |    |         |--Index Scan(OBJECT:([pubs].[dbo].[titles].[titleind] AS [t]))
            |    |         |--Index Seek(OBJECT:([pubs].[dbo].[titleauthor].[titleidind] AS [ta]), SEEK:([ta].[title_id]=[t].[title_id]) ORDERED FORWARD)
            |    |--Clustered Index Seek(OBJECT:([pubs].[dbo].[authors].[UPKCL_auidind] AS [a]), SEEK:([a].[au_id]=[t].[title_id]) ORDERED FORWARD)
            |--Index Seek(OBJECT:([pubs].[dbo].[sales].[titleidind] AS [s]), SEEK:([s].[title_id]=[a].[au_id]) ORDERED FORWARD)
				
???? ?? ?????? titleauthor ?????? ?????? ??? ?????? ???? ? WHERE ??? ????? ??? titleauthor ???? ??????? ??? ??? ??????. ????? ??????? ??? ????????? ??????, ???? ??? ??? ????? ???? ???? ?????? ????? ?? "??? ??????" ? "???? ????? ??? ????? ???, ??? ????? ?? ?? ???? ?????? ?????? ?????????. ???? ????????? ?????? ?? ??? ?????? ???? ??? ???? ????? ? ??? ??? ?????? ????? ????? ??? ????? ?????? ??????? ???? ?????? ????????.

??? ??????? ????? ????? ?????? ???? ??? ????? ??? ??? ????? ??????? ??????. ??? ??? ??? ??????? ????? ???? ??????? ??????? ??? ????? ??????? ??? ???? ?? ???? ??? ?????? ???? ?????? ??? ?? ??? ????? ??????? ????? ?? ????? ???????. ??? ???? ???????? ?? ??????? ??????? ??? ????? ???? ???? ???? ?????? ???? ??? ??????.

???????

???? ???????: 318530 - ????? ??? ??????: 26/????/1429 - ??????: 5.1
????? ???
  • Microsoft SQL Server 2000 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Workgroup Edition
????? ??????: 
kbmt kbhotfixserver kbqfe kbsqlserv2000sp3fix kbbug kbfix kbsqlserv2000presp3fix KB318530 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????318530

????? ???????

 

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