Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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


Ïà¹ØÎĵµ£º

Oracleά»¤³£ÓÃSQLÓï¾ä»ã×Ü

Oracleά»¤³£ÓÃSQLÓï¾ä»ã×Ü
ÉÏһƪ / ÏÂһƪ  2008-09-04 11:25:01
²é¿´( 1991 ) / ÆÀÂÛ( 0 ) / ÆÀ·Ö( 0 / 0 )
ÈçºÎÔ¶³ÌÅжÏOracleÊý¾Ý¿âµÄ°²×°Æ½Ì¨
select * from v$version;
²é¿´±í¿Õ¼äµÄʹÓÃÇé¿ö
select sum(bytes)/(1024*1024) as free_space,tablespace_name
from dba_free_space
group by tablespace_ ......

ÈçºÎÈÃÄãµÄSQLÔËÐеøü¿ì(תÌù)

ÈçºÎÈÃÄãµÄSQLÔËÐеøü¿ì(תÌù)    
  ----   ÈËÃÇÔÚʹÓÃSQLʱÍùÍù»áÏÝÈëÒ»¸öÎóÇø£¬¼´Ì«¹Ø×¢ÓÚËùµÃµÄ½á¹ûÊÇ·ñÕýÈ·£¬¶øºöÂÔ  
  Á˲»Í¬µÄʵÏÖ·½·¨Ö®¼ä¿ÉÄÜ´æÔÚµÄÐÔÄܲîÒ죬ÕâÖÖÐÔÄܲîÒìÔÚ´óÐ͵ĻòÊǸ´ÔÓµÄÊý¾Ý¿â  
  »·¾³ÖУ¨ÈçÁª»úÊÂÎñ´¦ÀíOLTP»ò¾ö²ßÖ§³ÖϵͳDSS£©ÖбíÏÖµÃÓ ......

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Óï¾äµÄÒ³Ãæ´æ´¢¹ý³Ì

ALTER PROCEDURE [dbo].[GetUsersList]
@BigClassID int=0,--´óÀà±ðID
@SmallClassID int=0 ,--СÀà±ðID
@pageindex int=1,
@pagesize int=3,
@ret int output --¹²¼¸Ìõ
AS
set rowcount @pagesize
if @SmallClassID>0
begin
select * from(
select id,BigClassName,SmallClassName,UserName,Corporation,r ......

³¬¼¶ÓÐÓõÄSQLÓï¾ä(·ÖÎöSQL SERVER Êý¾Ý¿â±í½á¹¹×¨ÓÃ)

³¬¼¶ÓÐÓõÄSQLÓï¾ä £¨ÓÃÓÚSQL SERVER ·þÎñÆ÷£©
³¬¼¶ÓÐÓõÄSQLÓï¾ä £¬Ö´Ðк󷵻صÄÁзֱðÊÇ£º±íÃû¡¢ÁÐÃû¡¢ÁÐÀàÐÍ¡¢Áг¤¶È¡¢ÁÐÃèÊö¡¢ÊÇ·ñÖ÷¼ü£¬Óï¾äÈçÏ£º
(·ÖÎöSQL SERVER Êý¾Ý¿â±í½á¹¹×¨ÓÃ)
Select Sysobjects.Name As ±íÃû,
       Syscolumns.Name As ÁÐÃû,
     ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ