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

½«accessµ¼ÈëSQL server £¨×ª£©

ÊìϤSQL SERVER 2000µÄÊý¾Ý¿â¹ÜÀíÔ±¶¼ÖªµÀ£¬ÆäDTS¿ÉÒÔ½øÐÐÊý¾ÝµÄµ¼Èëµ¼³ö£¬Æäʵ£¬ÎÒÃÇÒ²¿ÉÒÔʹÓÃTransact-SQLÓï¾ä½øÐе¼Èëµ¼³ö²Ù×÷¡£ÔÚ Transact-SQLÓï¾äÖУ¬ÎÒÃÇÖ÷ҪʹÓÃOpenDataSourceº¯Êý¡¢OPENROWSET º¯Êý£¬¹ØÓÚº¯ÊýµÄÏêϸ˵Ã÷£¬Çë²Î¿¼SQLÁª»ú°ïÖú¡£ÀûÓÃÏÂÊö·½·¨£¬¿ÉÒÔÊ®·ÖÈÝÒ×µØʵÏÖSQL SERVER¡¢ACCESS¡¢EXCELÊý¾Ýת»»£¬Ïêϸ˵Ã÷ÈçÏ£º
Ò»¡¢SQL SERVER ºÍACCESSµÄÊý¾Ýµ¼Èëµ¼³ö
³£¹æµÄÊý¾Ýµ¼Èëµ¼³ö£º
ʹÓÃDTSÏòµ¼Ç¨ÒÆÄãµÄAccessÊý¾Ýµ½SQL Server£¬Äã¿ÉÒÔʹÓÃÕâЩ²½Öè:
¡¡¡¡¡ð1ÔÚSQL SERVERÆóÒµ¹ÜÀíÆ÷ÖеÄTools£¨¹¤¾ß£©²Ëµ¥ÉÏ£¬Ñ¡ÔñData Transformation
¡¡¡¡¡ð2Services£¨Êý¾Ýת»»·þÎñ£©£¬È»ºóÑ¡Ôñ  czdImport Data£¨µ¼ÈëÊý¾Ý£©¡£
¡¡¡¡¡ð3ÔÚChoose a Data Source£¨Ñ¡ÔñÊý¾ÝÔ´£©¶Ô»°¿òÖÐÑ¡ÔñMicrosoft Access as the Source£¬È»ºó¼üÈëÄãµÄ.mdbÊý¾Ý¿â(.mdbÎļþÀ©Õ¹Ãû)µÄÎļþÃû»òͨ¹ýä¯ÀÀÑ°ÕÒ¸ÃÎļþ¡£
¡¡¡¡¡ð4ÔÚChoose a Destination£¨Ñ¡ÔñÄ¿±ê£©¶Ô»°¿òÖУ¬Ñ¡ÔñMicrosoft OLE¡¡DB Prov ider for SQL¡¡Server£¬Ñ¡ÔñÊý¾Ý¿â·þÎñÆ÷£¬È»ºóµ¥»÷±ØÒªµÄÑéÖ¤·½Ê½¡£
¡¡¡¡¡ð5ÔÚSpecify Table Copy£¨Ö¸¶¨±í¸ñ¸´ÖÆ£©»òQuery£¨²éѯ£©¶Ô»°¿òÖУ¬µ¥»÷Copy tables£¨¸´ÖƱí¸ñ£©¡£
    ¡ð6ÔÚSelect Source Tables£¨Ñ¡ÔñÔ´±í¸ñ£©¶Ô»°¿òÖУ¬µ¥»÷Select All£¨È«²¿Ñ¡¶¨£©¡£ÏÂÒ»²½£¬Íê³É¡£
Transact-SQLÓï¾ä½øÐе¼Èëµ¼³ö£º
1.ÔÚSQL SERVERÀï²éѯaccessÊý¾Ý:
SELECT * from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0','Data Source="c:\DB.mdb";User ID=Admin;Password=')±íÃû
2.½«accessµ¼ÈëSQL server
ÔÚSQL SERVER ÀïÔËÐÐ:
SELECT * INTO newtable from OPENDATASOURCE ('Microsoft.Jet.OLEDB.4.0','Data Source="c:\DB.mdb";User ID=Admin;Password=' )±íÃû
3.½«SQL SERVER±íÀïµÄÊý¾Ý²åÈëµ½Access±íÖÐ
ÔÚSQL SERVER ÀïÔËÐУº
insert into OpenDataSource( 'Microsoft.Jet.OLEDB.4.0','Data Source=" c:\DB.mdb";User ID=Admin;Password=')±íÃû (ÁÐÃû1,ÁÐÃû2) select ÁÐÃû1,ÁÐÃû2 &nb


Ïà¹ØÎĵµ£º

SQL Server 2005ÖеÄT SQLÔöÇ¿(7) ͨÓñí±í´ïʽCTE

ͨÓñí±í´ïʽ Common Table Expressions
ͨÓñí±í´ïʽ£¨CTE£©ÊÇÒ»¸ö¿ÉÒÔÓɶ¨ÒåÓï¾äÒýÓõÄÁÙʱ±íÃüÃûµÄ½á¹û¼¯¡£ÔÚËûÃǵļòµ¥ÐÎʽÖУ¬Äú¿ÉÒÔ½«CTEÊÓΪÀàËÆÓÚÊÓͼºÍÅÉÉú±í»ìºÏ¹¦ÄܵĸĽø°æ±¾¡£ÔÚ²éѯµÄfrom×Ó¾äÖÐÒýÓÃCTEµÄ·½Ê½ÀàËÆÓÚÒýÓÃÅÉÉú±íºÍÊÓͼµÄ·½Ê½¡£Ö»Ð붨ÒåCTEÒ»´Î£¬¼´¿ÉÔÚ²éѯÖжà´ÎÒýÓÃËü¡£ÔÚCTEµÄ¶¨ÒåÖУ¬¿ÉÒÔÒ ......

SQL SERVER 2008 ±íÖµ²ÎÊý

/*
SQL SERVER 2008 ±íÖµ²ÎÊý
 
    SQL SERVER ÒýÈëÁË¿¹ÒéÓÃÀ´½«Ðм¯´«Èëµ½´æ´¢¹ý³ÌºÍÓû§¶¨Ò庯ÊýµÄ±íÖµ²ÎÊý.
Õâ¸ö¹¦ÄÜ¿ÉÒÔʹ´æ´¢¹ý³ÌºÍº¯Êý¾ßÓзâ×°¶à¸öÐм¯µÄ¹¦ÄÜ,¶ø²»ÊDZØÐëÒ»ÐÐÒ»Ðеص÷
Êý¾ÝÐ޸Ĺý³ÌºÍ´©¼þ¶à¸öÊäÈë²ÎÊýÀ´ÉúÓ²µÄת»¯Îª¶àÐÐ.
 
    ÎÒÃÇÔÚÓ¦ÓÃÖо­³£Óà ......

oracle sql*plus set &spool½éÉÜ(Ò»)

1). ÉèÖõ±Ç°sessionÊÇ·ñ¶ÔÐ޸ĵÄÊý¾Ý½øÐÐ×Ô¶¯Ìá½» :SET AUTO[COMMIT] {ON|OFF|IMM[EDIATE]| n}
SQL> set autocommit off
2)£®ÔÚÓÃstartÃüÁîÖ´ÐÐÒ»¸ösql½Å±¾Ê±£¬ÊÇ·ñÏÔʾ½Å±¾ÖÐÕýÔÚÖ´ÐеÄSQLÓï¾ä :SET ECHO {ON|OFF}
SQL> set echo on
3).ÊÇ·ñÏÔʾµ±Ç°sqlÓï¾ä²éѯ»òÐ޸ĵÄÐÐÊý
SQL> SET FEED[BACK] {6|n|O ......

oracle ³£ÓÃÐÔÄܲéѯSQL·ÖÏí

select count(1) from dictionary;
select * from dba_data_files;
select count(1) from dba_objects t where t.owner='BESTTONE';
select * from dba_tablespaces t where t.tablespace_name='BESTTONE';
select count(1) from dba_tables t where t.owner='BESTTONE';
select t.table_name,t.comments from diction ......

SQL ServerÖеÄÃüÃû¹ÜµÀ(named pipe)¼°ÆäʹÓÃ

1. ʲôÊÇÃüÃû¹ÜµÀ£¿
ÓëTCP/IP£¨´«Êä¿ØÖÆЭÒé»òinternetЭÒ飩һÑù£¬ÃüÃû¹ÜµÀÊÇÒ»ÖÖͨѶЭÒé¡£ËüÒ»°ãÓÃÓÚ¾ÖÓòÍøÖУ¬ÒòΪËüÒªÇó¿Í»§¶Ë±ØÐë¾ßÓзÃÎÊ·þÎñÆ÷×ÊÔ´µÄȨÏÞ¡£
Òª½âÊÍÕâ¸öÎÊÌ⣬ÎÒ»¹ÊÇժ¼΢Èí¹Ù·½µÄ×ÊÁϱȽϺÃ
http://msdn.microsoft.com/zh-cn/library/ms187892.aspx
ÈôÒªÁ¬½Óµ½ SQL Server Êý¾Ý¿âÒýÇ棬±ØÐëÆô ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ