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

Îı¾µÄµ¼Èëµ¼³öºÍSQL½Å±¾µÄÖ´Ðз½·¨


Ò».Îı¾µ¼ÈëÊý¾Ý¿â
--²½Öè1.´´½¨¿ØÖÆÎļþ
load data¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ --1¡¢¿ØÖÆÎļþ±êʶ
infile 'E:\oradata\orcl\test\inf_user.txt'¡¡¡¡¡¡¡¡¡¡¡¡¡¡ --2¡¢ÒªÊäÈëµÄÊý¾ÝÎļþÃûΪinf_user.txt   (Îļþȱʡ·Åµ½C:\ Ï£¬Èç¹û²»ÊÇ£¬¾ÍÐèÒªÖ¸Ã÷ȫ·¾¶)
append into table inf_user¡¡¡¡¡¡¡¡--3¡¢Ïò±ítestÖÐ×·¼Ó¼Ç¼
fields terminated by X'09'¡¡¡¡--4¡¢×Ö¶ÎÖÕÖ¹ÓÚX'09'£¬ÊÇÒ»¸öÖÆ±í·û£¨TAB£©
(mobile,id)¡¡¡¡ -----¶¨ÒåÁжÔӦ˳Ðò
--a¡¢insert£¬ÎªÈ±Ê¡·½Ê½£¬ÔÚÊý¾Ý×°ÔØ¿ªÊ¼Ê±ÒªÇó±íΪ¿Õ
--b¡¢append£¬ÔÚ±íÖÐ×·¼ÓмǼ
--c¡¢replace£¬É¾³ý¾É¼Ç¼£¬Ìæ»»³ÉÐÂ×°ÔØµÄ¼Ç¼
--d¡¢truncate£¬Í¬ÉÏ
--²½Öè2.sqlldr
sqlldr user_test/user_test@orcl control=E:\oradata\orcl\test\input.ctl
¶þ.µ¼³öÎı¾£º
·½·¨1£º
  SQL>spool d:\output.xls
  SQL>   set   heading   off; --½ûÖ¹Êä³öÁбêÌâ  
  SQL>   set   feedback   off; --½ûÖ¹ÏÔʾ×îºóÒ»ÐеļÆÊý·´À¡ÐÅÏ¢  
  SQL>   set   pagesize   50000; --ÉèÖÃÏÔʾ¶àÉÙÐдòÓ¡Ò»´ÎÁÐÃû 
  SQL>select * from inf_user;
  SQL>spool   off  
·½·¨2£º
developer-file-new-sql windows-ÓÒ¼ü²éѯ½á¹û-export results-tsv
Èý.Ö´ÐÐSQL½Å±¾
SQL> @c:aa.sql;


Ïà¹ØÎĵµ£º

²âÊÔSQL ServerÖ´ÐÐʱ¼äºÍCPUʱ¼ä

ÔÚÐèÒª²âÊÔsqlÓï¾ä»òÕß´æ´¢¹ý³ÌÐÔÄܵÄʱºò¿ÉÒÔÓõÃÉÏ
  CHECKPOINT --ÓÃÓÚ¼ì²éµ±Ç°¹¤×÷µÄÊý¾Ý¿âÖб»¸ü¸Ä¹ýµÄÊý¾ÝÒ³»òÈÕÖ¾Ò³£¬²¢½«ÕâЩÊý¾Ý´ÓÊý¾Ý»º³åÆ÷ÖÐÇ¿ÖÆÐ´ÈëÓ²ÅÌ
  GO
  DBCC FreeProcCache --´Ó»º³å³ØÖÐɾ³ýËùÓлº³åÇø
  DBCC DropCleanBuffers&nbs ......

ͨ¹ýSQL´æ´¢¹ý³Ìɾ³ý¹ýÆÚµÄÊý¾Ý¿âBak±¸·ÝÎļþ

1.ÏÈÆôÓà xp_cmdshell À©Õ¹´æ´¢¹ý³Ì£º
Use Master
GO
Exec sp_configure 'show advanced options', 1
GO
Reconfigure;
GO
sp_configure 'xp_cmdshell', 1
GO
Reconfigure;
GO
 (×¢£ºÒòΪxp_cmdshellÊǸ߼¶Ñ¡ÏËùÒÔÕâÀïÆô¶¯xp_cmdshell£¬ÐèÒªÏȽ« show advanced ......

JAVAÖзÀÖ¹SQL×¢Èë¹¥»÷ÀàµÄÔ´´úÂë

JAVA£­×Ö·û´®¹ýÂËÀà
package cn.com.hbivt.util;
/**
* Title:
*
* Description:
*
* Copyright: Copyright (c) 2005
*
* Company:
*
* @author not attributable
* @version 1.0
*/
public class StringUtils {
   ......

vba ½«excel²åÈësqlÊý¾Ý¿â

Private Sub insert1_click()
Dim iCount As Integer
Dim cn
Set cn = CreateObject("ADODB.Connection")
cn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=8233;Initial Catalog=hskmis;Data Source=127.0.0.1"
cn.Open
cn.Execute ("delete temp9")
'¼ÆËã¸Ã±íÓжàÉÙÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ