???? ?????? ??? ????? ??????? ?? SQL Server 2005 ?????? ???? ??? ???? ????? ??? ?? ??? ?????? ??? ???? ??? ?????? ??????

?????? ????????? ?????? ?????????
???? ???????: 942982 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

???????

???? ??? ????????? ??????:
  • ???? ??????? ????? ???? ??? ???? ????? ?? ??? ?????? ??? ???? ??? ?????? ??????.
  • ?????? ?????? ?????? Microsoft SQL Server 2005.
  • ??? ?????? ?????? ????? ????????? ?? SQL Server 2005.
?? ??? ?????????? ?????? ????? ????????? ?? ?????? ??? ????????? ?? Microsoft SQL Server 2000. ??? ???? ??????? ??? ????? ????????? ?? SQL Server 2000 ???? ????????? ??? ?? 1 ????? ??? ???????. ??? ???? ??? ????? ????????? ?? SQL Server 2005 ???? ????????? 24 ????? ??????? ??????.

?????

????? ????????? ????? "?????? ??????" ??? ?????? ??? ???? ?????. ??? ????? ????????? ?? SQL Server 2005 ????? "?????? ??????" ??????? ???? ?????? ?? ??????. ??? ??? ?????? ????? ??? ???? ????? ? ????? "?????? ??????" ????? ?????? ????????.

??? ???? ??? ????? ????????? ?? SQL Server 2000 ??????? "????????? ??????" ?????? ????????? ?????? ??? ???? ?????. ????? ??? ??? ?????? ????? ??? ???? ????? ? "???? ??????" ????? ??????? ?? ??? ????.

???? ??????

??????? ?????? ??? ??? ??????? ?? ?????? ??? UNIQUE ?? ??? PRIMARY KEY ?? ?????? ??? ?????? ??????. ?? ?????? ????? "??? ?????? ????????? ?? ????? JOIN.

??? ???? ??????? ????? ???? DECLARE ???????? ?? ?????? 4 ?? "???? ?? ?????????" ?????? ??????:
DECLARE @t2 table (c1 int primary key, c2 int)

?????

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

??????? ????

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


?????? ????? ??????? ??????? ???? ?????? ???? ???? ????? ??????? SQL Server 2005. ?? ??? ???? ???? ServerA\SQL2005. ?? ??? ?????? ServerB\SQL2005.
  1. ????? ???????? ??????? ?????? ????? ?????? ?? SQL Server ????? Studio ??? ???? ServerA ?? SQL Server 2005:
    USE MASTER
    GO
    IF EXISTS (SELECT * FROM sysdatabases where name = 'LinktestTarget')
    	DROP DATABASE LinktestTarget
    GO
    CREATE DATABASE LinktestTarget
    GO
    
    ALTER DATABASE LinktestTarget MODIFY FILE
    (NAME = 'LinktestTarget', SIZE = 200MB)
    GO
    ALTER DATABASE LinktestTarget MODIFY FILE
    (NAME = 'LinktestTarget_log', SIZE = 100MB)
    GO
  2. ????? ???????? ??????? ????? ???? ????? ?? ????? Studio ??? ???? ServerB ?? SQL Server 2005: nvarchar(50) @ serverName
    DECLARE @serverName nvarchar(50)
    SET @serverName = @@serverName
    
    IF EXISTS (SELECT * FROM master..sysservers WHERE srvname = 'LS')
    	EXEC master.dbo.sp_dropserver @server=N'LS', @droplogins='droplogins'
    
    EXEC sp_addlinkedserver
        @server = N'LS',
        @srvproduct = N'SQLDB',
        @provider = N'SQLOLEDB',
        @datasrc = N'ServerA\SQL2005',
        @catalog = N'LinktestTarget'
    
    EXEC sp_serveroption N'LS', N'data access', N'true'
    EXEC sp_serveroption N'LS', N'rpc out', N'true'
    EXEC sp_serveroption N'LS', N'rpc', N'true'
    EXEC sp_serveroption N'LS', N'use remote collation', N'true'
    EXEC sp_addlinkedsrvlogin
      @rmtsrvname = N'LS',
      @useself = N'true',
      @locallogin = N'sa'
  3. ????? ??????? ??????? ?????? ???? ??? ???? ServerA ?? SQL Server 2005 ??? ?? ??? ?????? ?? 50,000 ???? ?? ????????:
    USE LinktestTarget
    GO
    CREATE TABLE [T1] (
    	[c1] [int]  NOT NULL,
    	[c2] [int] NOT NULL,
    	[c3] char (4000) NOT NULL,
    	CONSTRAINT [PK_t1] PRIMARY KEY CLUSTERED ([c1])
    WITH FILLFACTOR = 80 ON [PRIMARY] 
    ) ON [PRIMARY]
    GO
    SET NOCOUNT ON
    GO
    DECLARE @counter int
    SET @counter = 1
    
    WHILE @counter < 50000
    BEGIN
    	INSERT INTO T1 (c1, c2, c3) VALUES (@counter, @counter,'')
    	SET @counter = @counter + 1
    END
    GO
    UPDATE STATISTICS T1 (PK_t1) WITH FULLSCAN
  4. ????? ???????? ??????? ??? ???? ServerB ?? SQL Server 2005. ???? ?? ?????? ????.
    DECLARE @t2 table (c1 int, c2 int)
    INSERT INTO @t2 (c1, c2) VALUES (399990, 399990)
     
    UPDATE A
    SET A.c2 = B.c2
    FROM LS.LinktestTarget.dbo.T1 AS A 
    	JOIN @t2 as B on B.c1 = A.c1

???????

???? ???????: 942982 - ????? ??? ??????: 11/????/1428 - ??????: 1.1
????? ???
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Workgroup Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
????? ??????: 
kbmt kbexpertiseadvanced kbtshoot kbprb KB942982 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????942982

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

 

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