FIX: ??? ???? ??? ?? ???? ???? ????? ????? ???????? ??? ?? ?? ???????? ????? ????? ?? ?????????? ????? ?? ?????? ???? ?? ?? ?????? ?? ?? ??? ??? ?????? ?????? ????? ?? ??? ??? SQL Server 2008 ??? ??

???? ?????? ???? ??????
???? ID: 956718 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
Bug #: 50003167 (SQL ????????)
???? ??????? ?? ??? ?????? ???? ?? builds SQL ?????? ???? ?? ??? ?????? ??? ??, ?? ???? ?? Microsoft ???????? ??? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
957826SQL Server 2008 ?? ??? ?????? ??? ?? ?? ????? ?? ???? ?? SQL Server 2008 ?? ???? ??? ???? ??????? ??????? ?? ???? ??? ?? SQL Server 2005 SQL Server 2005 ?????? ??? 2 ?? ??? ?????? ??? ?? ?? ????? ??
??? ?? ??????? ???? | ??? ?? ??????? ????

?????

Microsoft SQL Server 2008, ??? ????? ????? ???????? ?? ???? ?? ???? ???? ?? ????? ????????? ???? ???:
  • ???? ???? ??? ?? ???? ???? ??? ???
  • ?????? ?? ?????? ????? nonclustered ????? ??????????? ??? ???
?? ???????? ?? ????? ????.. ??? ?? ??? ?? ?? ???? ??????? ????? ??????Column1???? ?????? ?? ??? ??, ??Table1.Table1???? ?????? ?? ??? ?? ????? ????? ???????? ?????? ???????? ??Table2.

?????? ??? ?? rows ??Table1?? ?? ???? ??? ?? ???? ????? ??? ??? ???? ??? ??,Table2????????? ?? ??? dangling ?????? ?? ????Table1.

?? ?????? ???? ?? ?? ???????? ?? ??? ?? ????? ????????? ???? ???:
  • ????????Column1?????Table1?????????? ????? ?? ??? ???? ??.Table1.
  • ???? ?? ??????? ??? ????? ???? ??? ?? ????Column1?????? ?????? ?? ???, ?????????? ???????? ??? ?? ?? ???? ??:
    • ???? ????? ??? ???? ?? ??? ?????? ??? ?????? ?? ???, ???? ????? ?? ?? ????? ?? ??? ???? ????? ??? ?? ??:
      • select <ConstantValues>
      • select <Parameters>
      ???:?? ???????? ??? ???? ???? ?? ?? ???????? ???
    • ???? ????? ??? ???? ?? ?????? ??? ??? ?????? ??? ?????? ?? ???, ???? ????? ?? ?? ????? ?? ??? ???? ????? ??? ?? ??:
      • select <ColumnName> from <TableName> where <TableName>.<ColumnName> = 1
        ???:<tablename></tablename>.<columnname></columnname>????? ?? ?????? ??????????? ?????? ??? ??????? ??? ??? ???
      • select top 1 <ColumnName> from <TableName>
    • ???? ????? ?? ???? ?????? ?? ??? ????? ?? ???? predicate guarantees ?? ?? ???? ??? ?????? ?? ?????? ???? ????? ?? ???
    • ?????? ??? ??? ???? ??Column1????? ???, ???? ????? ???? ???? ?? ??? ??????
  • ???????? ???? ???????? ?? ????? ????? ???????? ??? ????? ???? ??Table2.
???:?? ??????? ???? ??? ?? ?? ?? ???????? ?? ???? ??? ?? nonclustered ????? ????????????? ?? ????? ????? ?????? ?? ?????? ???????? ?? ??????? ?? ?????? ???? ?? ??? ???? ??? ?? ????? ?????

????????

?? ?????? ?? ????? ????? ?????? 1 ??? ???? ?????? ???? ??? ???SQL Server 2008 ?? ??? ?? ????? ?????? ?????? ?? ??????? ???? ?? ??? ???? ???? ?? ???? ??? ???? ??????? ?? ??? Microsoft ???????? ??? ???? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
956717SQL Server 2008 ?? ??? ????? ?????? ?????? 1
???:Builds ????? ???? ???, ??????? ?? ?? ????? ?????? ??? ??? ?????????? ?? ?? ??? ??????? ??????? ????? SQL Server 2008 ?? ??? ????? ?? ?? ??? ???? ??? ?? ??????? ???? ??? ?? ?? ????? ?????? ????? ?????? ?????? ?? ???????? ?? ???? ???? ?? ??? ??????? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????::
956909SQL Server 2008 SQL Server 2008 ?????? ???? ?? ??? ?????? ??? ?? ?? ????? ??

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

???????? ????? eliminates ?????? ??? ??? ???? "?????" ??? ??? ?????? ???????? ??? ???? ??? ?? ????? ?? ??? ?? ?? ???????? ?? ???? ???? ?? ??? ???? ????? ???, ?? ?? ?????? ?? ??? ???? ?? ???, ????? ????? ?? ???? ????:
  1. ???? ??? ????????? ?? ???? ????? ?? ??? ??? ??? ??? ??????, temp ?????? ?? ???-???????? ?????? ??? ???? ?? ???? ?????? ?? ????
  2. ????? ???? 8790 ?? ????? ????? ?? ????? ???? forces ??????????? ????? ?? ??? ???? ???? ?? ?? ?????? ?? ??????? ????? ?? ?? ?????? ?? ????? ???? ?? ??? ??? ??????? ?????? ??????? ?? ??? ?????? ???? ???? ?? ??? ??? ??? DML ????? ?? ??? ???????? ????? carries. ?????, ?? ????? ?? ????????? ?? ????????? ???? ?? ??? ????? ?? ?? ?? ?? ?? ??? ?? ????? ?????
????? Transact SQL ????????? ?????? ?? ??? ?? ?? ???????? ?? ???? ???? ???? ?? ???? ??, ?? ?? ?????? ?? ?? ???? ?? ??? ???? ????????? ?? ????????? ???? ?? ?? ????? ???

?????? ?? ???, ???? ??? ?? ????????? ?? ????? ?? ???? ???? ??:
use tempdb;

drop table sale, product;
create table product(pno int not null primary key, name char(30), pAlternateKey char(6) not null unique);
create table sale(sno int not null primary key, pAlternateKey char(6) not null references product(pAlternateKey));
insert product values(1, 'Office Chair', 'ochair');
insert sale values(1, 'ochair')

-- No violation of foreign key constraint is detected. However, one should be.
merge into product
using (select 'Office Chair2' as name, 1 as pno, 'oxx' as pAlternateKey) as src
on product.pno = src.pno
when matched then
   update set product.pAlternateKey = src.pAlternateKey, 
              product.name = src.name
when not matched then
   insert values(src.pno, src.name, src.pAlternateKey);
????????? ????? ???? ?? ????? ?? ???? ????:
insert product values(1, 'Office Chair', 'ochair');
insert sale values(1, 'ochair')
-- A foreign key constraint violation is detected, and the update fails.
declare @source table 
   (name nchar(30), pno int, pAlternateKey nchar(30));
insert into @source values('Office Chair2',1,'oxx');

merge into product
using @source as src
on product.pno = src.pno
when matched then
   update set product.pAlternateKey = src.pAlternateKey, 
              product.name = src.name
when not matched then
   insert values(src.pno, src.name, src.pAlternateKey);

??????

Microsoft ?? ?????? ?? ?? ?? ?? ?? Microsoft ???????? ??? ?? ?????? ?? ?? "???? ???? ???? ???" ?????? ???????? ???..

???? ???????

???? ??????? ?? ????????? ???? ?? ???? ??? ???? ??????? ?? ???, ?? ???? ?? ??? ???? ?? ????? ?????? ?????? ?????? ?? Microsoft ???????? ???? ??? ?????? ???????? ?? ???? ???? ?? ???? ??? ??????? ?? ???, Microsoft ???????? ??? ???? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
956717SQL Server 2008 ?? ??? ????? ?????? ?????? 1

??????

???? ??????? ?? ??? ???? ?? builds SQL Server 2008 ?? ?????? ???? ?? ??? ?????? ???, Microsoft ???????? ??? ???? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
956909SQL Server 2008 SQL Server 2008 ?????? ???? ?? ??? ?????? ??? ?? ?? ????? ??


???? ??????? ?? ??? ????????? Servicing ???? SQL ????? ?? ???, Microsoft ???????? ??? ???? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
935897?? ????????? Servicing ???? ?? SQL Server ??? ?? ??????? ?? ?? ???????? ?? ??? ?? ???????? ?? ?????? ???? ?? ??? ?????? ??


SQL ????? ?????? ?? ??? ?????? ?????? ?? ???? ??? ???? ??????? ?? ??? Microsoft ???????? ??? ???? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
822499Microsoft SQL Server ?????????? ?????? ???????? ?? ??? ??? ?????? ??????


?????????? ?????? ???????? ?? ???? ??? ???? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????::
824684Microsoft ?????????? ???????? ?? ????? ???? ?? ??? ????? ?? ???? ???? ???? ???????? ?? ?????

??????

SQL Server 2008 ??? nonclustered ????????????? ?? ???? ??? ???? ??????? ?? ??? ????? Microsoft ?????? ??????? (MSDN) ??? ???? ?? ????:
(SQL.100) http://MSDN.Microsoft.com/en-us/library/ms179325 .aspx

???

???? ID: 956718 - ????? ???????: 06 ?????? 2010 - ??????: 2.0
???? ???? ???? ??:
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2008 Standard Edition for Small Business
  • Microsoft SQL Server 2008 Web
  • Microsoft SQL Server 2008 Workgroup
  • Microsoft SQL Server 2008 Express
  • Microsoft SQL Server 2008 Express with Advanced Services
??????: 
kbautohotfix kbqfe kbPubTypeKC kbfix kbmt KB956718 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:956718

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

 

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