Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL SERVER 2000ÖзÃÎÊOracleÊý¾Ý¿â·þÎñÆ÷µÄ¼¸ÖÖ·½·¨

ÔÚSQL SERVER 20000ÖзÃÎÊOracleÊý¾Ý¿â·þÎñÆ÷µÄ¼¸ÖÖ·½·¨
1.ͨ¹ýÐм¯º¯Êýopendatasource
ÒªÇó:±¾µØ°²×°Oracle¿Í»§¶Ë
select * from opendatasource('MSDAORA', 'Data Source=XST4;User ID=manager;Password=sjpsjsjs')..MISD.PBCATCOL
ÆäÖУ¬MSDAORAÊÇOLEDB FOR OracleµÄÇý¶¯£¬
×¢Òâ:Óû§ÃûºÍ±íÃûÒ»¶¨Òª´óС£¬·þÎñÆ÷ºÍÓû§ÃûÖ®¼äÊÇÁ½¸öµã£»
ÀýÈç:
select top 10 * from opendatasource('MSDAORA', 'Data Source=HZTEST;User ID=osstest;Password=a1234')..OSSTEST.SUBSCRIBER
±¾µØOracle¿Í»§¶ËÅäÖÃÎļþÖÐÄÚÈÝÈçÏÂ:
HZTEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 132.149.7.19)(PORT = 1521))
)
(CONNECT_DATA =
(SID = test)
)
)
2. ʹÓÃMS SQLµÄopenrowsetº¯Êý
select A.* from openrowset('MSDAORA','XST4';'manager';'sjpsjsjs', 'MISD.PBCATCOL') as A
order by A.ID
ʹÓÃÕâÖÖ·½Ê½Ò»¶¨ÒªÓñðÃû²ÅÐÐ
3.ʹÓÃODBC·½Ê½
select A.* from openrowset('MSDAORA','XST4_ODBC';'manager';'sjpsjsjs', 'MISD.PBCATCOL') as A order by A.ID
XST4_ODBCÊÇODBCÊý¾ÝÔ´
4.ʹÓÃÁ´½Ó·þÎñÆ÷·½Ê½
EXEC SP_ADDLINKEDSERVER
@server='mylinkedserver', --Á´½Ó·þÎñÆ÷Ãû³Æ
@srvproduct='Oracle', --¹Ì¶¨
@provider='MSDAORA', --¹Ì¶¨
@datasrc='XST4' --Oracle±¾µØ·þÎñÃû
¸ÃÎÄÕÂתÔØ×ÔµÂ×й¤×÷ÊÒ£ºhttp://www.dezai.cn/article_show.asp?ArticleID=17285


Ïà¹ØÎĵµ£º

ʹÓÃset statistics on À´¼ì²ésql tuningµÄ½á¹û


ÔÚSQL Server2005/2008ÖпÉÒÔʹÓÃÒ»ÏÂËĸöÃüÁîÀ´µ÷ÓÅsqlÓï¾äÒÔ¼°¼ì²éµ÷ÓŵĽá¹û
set
 statistics time on

set
 statistics IO on

set
 statistics profile on

set
 statistics xml on

......

ÔÚPHPÖÐÈ«Ãæ×èÖ¹SQL×¢Èëʽ¹¥»÷Ö®Ò»

Ò»¡¢ ÒýÑÔ
¡¡¡¡PHPÊÇÒ»ÖÖÁ¦Á¿Ç¿´óµ«Ï൱ÈÝÒ×ѧϰµÄ·þÎñÆ÷¶Ë½Å±¾ÓïÑÔ£¬¼´Ê¹ÊǾ­Ñé²»¶àµÄ³ÌÐòÔ±Ò²Äܹ»Ê¹ÓÃËüÀ´´´½¨¸´ÔӵĶ¯Ì¬µÄwebÕ¾µã¡£È»¶ø£¬ËüÔÚʵÏÖÒòÌØÍø·þÎñµÄÃØÃܺͰ²È«·½ÃæÈ´³£³£´æÔÚÐí¶àÀ§ÄÑ¡£ÔÚ±¾ÏµÁÐÎÄÕÂÖУ¬ÎÒÃǽ«Ïò¶ÁÕß½éÉܽøÐÐweb¿ª·¢Ëù±ØÐèµÄ°²È«±³¾°ÒÔ¼°PHPÌض¨µÄ֪ʶºÍ´úÂë-Äã¿ÉÒÔ½èÒÔ±£»¤Äã×Ô¼ºµÄwebÓ¦Óó ......

Sql Server¸ù¾Ý¼Ç¼¼¯ÅúÁ¿¸üÐÂÊý¾Ý¿â

update   t1   set   t1.value=t2.value   from   t2   where   t1.id=t2.id
 
update jbsite_class  set topicnum = count
from (select t2.classid,count from (
select distinct classid,count(*) as count
from jbsite_product ......

SQL server²»ÄÜÔ¶³ÌÁ¬½Ó

Õâ¶Îʱ¼äÅöµ½Ò»¸öºÜÆæ¹ÖµÄÎÊÌ⣺SQL server²»ÄÜÔ¶³ÌÁ¬½Ó¡£ÃüÃû¹ÜµÀºÍTCP/IPЭÒ鶼ÒÑÆôÓ㬷À»ðǽҲ¹Ø±ÕÁ˵ȵȣ¬µ«¾ÍÊDz»ÄÜÔ¶³ÌÁ¬½ÓÊý¾Ý¿â¡£ÖÕÓÚÕÒµ½Ô­ÒòÁË£¬µ±ÊäÈëÊý¾Ý¿â·þÎñÆ÷ʵÀýÃûʱӦ£º\,£¬ ƽ³£Ò»°ã²»Óø½¼Ó¶Ë¿ÚºÅµÄ¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ