FIX: ??? ???? ???? LIKE [-] ??? ??????? ????

?????? ????????? ?????? ?????????
???? ???????: 290918 - ??? ???????? ???? ????? ????? ??? ???????.
BUG #: 352098 (SHILOH_bugs)
????? ???? | ?? ????

???????

??? ??????? ??? ??? ??? ???? ????? ??? ?????? [-] ? ?? ??? ???? ???? ?????? ??? ?? ??????? ????.

????

??? ??? ???????? ??? ?????? ??? ???? ???? ???? ?? SQL Server 2000. ?????? ??? ??????? ??????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
290211INF: ????? ?????? ??? ???? ???? ???? ??????? SQL Server 2000

???? ??????

???? ?????? ?????? ??? ?? ????? ???? ESCAPE ????? ?? ?????? ???? ???? ?? ???? ??? ?????? ????? ??? ???:
select * from dashes where no_key like 'a[~-]a%' ESCAPE '~'
select * from dashes where primary_key like 'a[~-]a%' ESCAPE '~'
				

?????

???? Microsoft ?? ??? ????? ?? SQL Server 2000. ?? ????? ??? ??????? ???? ??? ?? SQL Server 2000 Service Pack 1.

??????? ????

-- Incorrect result set is produced by a "SELECT" which uses the "LIKE" 
-- clause where one argument is a primary key column and the other is a
-- string literal with "[-]" in the middle of it.
use northwind
set nocount off

if ( object_id('dashes') is not NULL ) drop table dashes
create table dashes 
( primary_key varchar(20) primary key, no_key varchar(20) )
insert dashes values ( 'a-a-key', 'a-a-value' )

print 'next two statements correctly return one record each'
select * from dashes where no_key like 'a-a%'
select * from dashes where primary_key like 'a-a%'

print 'for the primary key query, it incorrectly returns no rows'
select * from dashes where no_key like 'a[-]a%'
select * from dashes where primary_key like 'a[-]a%'

				
next two statements correctly return one record each
primary_key          no_key               
-------------------- -------------------- 
a-a-key              a-a-value

(1 row(s) affected)

primary_key          no_key               
-------------------- -------------------- 
a-a-key              a-a-value

(1 row(s) affected)

for the primary key query, it incorrectly returns no rows
primary_key          no_key               
-------------------- -------------------- 
a-a-key              a-a-value

(1 row(s) affected)

primary_key          no_key               
-------------------- -------------------- 

(0 row(s) affected)
				

???????

???? ???????: 290918 - ????? ??? ??????: 12/?????/1424 - ??????: 3.2
????? ???
  • Microsoft SQL Server 2000 Standard Edition
????? ??????: 
kbmt kbbug kbfix kbsqlserv2000sp1fix KB290918 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????290918

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

 

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