ÎÒÏëÎÊÏÂÐéÄâÖ÷»úÔËÓªÉ̵ÄMSSQL¿Õ¼ä¿É²»¿ÉÒÔÔ¶³ÌÁ¬½Ó£¿
¾ÍÊÇ˵ÔÚÎҵĻúÆ÷ÉÏÄܲ»ÄÜÓÃSSMSÁ¬½ÓËûµÄ·þÎñÆ÷
Èç¹ûÓÐÇë¸æËßÎÒÔËÓªÉ̵ĵØÖ·£¬Ð»Ð»£¡
ÔËÓªÉ̵ĵØÖ·½ÐÔËÓªÉ̸æËßÄ㣬¹Ø¼üµÄÊÇËû³ýÁËÔÊÐíÄãµÄ»úÆ÷Á¬½ÓÍ⣬»¹µÃ¿ª·ÅÓû§ÃûºÍÃÜÂë¸øÄã
×Ô¼ºUP~£¡£¡£¡
ÍûÁ˽âµÄÅóÓÑ͸¶һÏÂ
/*²»Í¬·þÎñÆ÷Êý¾Ý¿âÖ®¼äµÄÊý¾Ý²Ù×÷*/
--´´½¨Á´½Ó·þÎñÆ÷
exec sp_addlinkedserver 'ITSV ', ' ', 'SQLOLEDB ', 'Ô¶³Ì·þÎñÆ÷Ãû»òipµØÖ· '
exec sp_addlinkedsrvlogin 'ITSV ', 'false ',null, 'Óû§Ãû ', 'ÃÜÂë '
--²éѯʾÀý
select * from ITSV.Êý¾Ý¿âÃû.dbo.±íÃû
--µ¼ÈëʾÀý
select * into ±í from ITSV.Êý¾Ý¿âÃû.dbo.±íÃû
--ÒÔºó²»ÔÙʹÓÃʱɾ³ýÁ´½Ó·þÎñÆ÷
exec sp_dropserver 'ITSV ', 'droplogins '
--Á¬½ÓÔ¶³Ì/¾ÖÓòÍøÊý¾Ý(openrowset/openquery/opendatasource)
--1¡¢openrowset
--²éѯʾÀý
select * from openrowset( 'SQLOLEDB ', 'sql·þÎñÆ÷Ãû '; 'Óû§Ãû '; 'ÃÜÂë ',Êý¾Ý¿âÃû.dbo.±íÃû)
--Éú³É±¾µØ±í
select * into ±í from openrowset( 'SQLOLEDB ', 'sql·þÎñÆ÷Ãû '; 'Óû§Ãû '; 'ÃÜÂë ',Êý¾Ý¿âÃû.dbo.±íÃû)
--°Ñ±¾µØ±íµ¼ÈëÔ¶³Ì±í
insert openrowset( 'SQLOLEDB ', 'sql·þÎñÆ÷Ãû '; 'Óû§Ãû '; 'ÃÜÂë ',Êý¾Ý¿âÃû.dbo.±íÃû)
select *from ±¾µØ±í
--¸üб¾µØ±í
update b
set b.ÁÐA=a.ÁÐA
from openrowset( 'SQLOLEDB ', 'sql·þÎñÆ÷Ãû '; 'Óû§Ãû '; 'ÃÜÂë ',Êý¾Ý¿âÃû.dbo.±íÃû)as a inner join ±¾µØ±í b
on a.column1=b.column1
--openqueryÓ÷¨ÐèÒª´´½¨Ò»¸öÁ¬½Ó
accessʱ²éѯËٶȻ¹Âù¿ìµÄ£¬ÏÖÔÚת³ÉmssqlÁË£¬Êý¾ÝÁ¿²¢²»´ó£¬Í¨³£Êý¾ÝÁ¿¶àЩµÄ¾ÍÊǼ¸Ç§Ìõ£¬µ±È«²¿ÁгöÊý¾ÝʱËÙ¶ÈÒ²²»Âý£¬¾ÍÊÇ°´Ìõ¼þËÑË÷ʱ¾ÍÂýÁË£¬ÇëÎÊÊDz»ÊǸúlikeÓйذ¡£¬µ«ÒÔÇ°ÓÃaccessÂù¿ìµÄ°¡£¬Ò²½¨Á¢ÁËË÷ÒýÁË ......