CSVÎļþµ¼Èëµ½SQL Server 2005Êý¾Ý¿âÖÐ
Ê×ÏÈÓòéѯÓï¾ä£¬´ÓtblTask±íÖвéѯ³öËùÓеÄÊý¾Ý£¬È»ºó½«Æä±£´æΪcsv¸ñʽ¡£
ÔÚSQLÓï¾ä´°¿Ú£¬ÊäÈëÈçÏÂÄÚÈÝ£º
USE Keii BULK INSERT dbo.tblTask
from 'd:\tblTask.csv' WITH (FIELDTERMINATOR = ',', ROWTERMINATOR = '\n')£¬¾Í¿É½«ÆäÌí¼Óµ½Êý¾Ý±íÖС£
Ïà¹ØÎĵµ£º
1.ͨ¹ý¹¤¾ßDTSµÄÉè¼ÆÆ÷½øÐе¼Èë»òµ¼³ö
¡¡¡¡DTSµÄÉè¼ÆÆ÷¹¦ÄÜÇ¿´ó£¬Ö§³Ö¶àÈÎÎñ£¬Ò²ÊÇ¿ÉÊÓ»¯½çÃ棬ÈÝÒײÙ×÷£¬µ«ÖªµÀµÄÈËÒ»°ã²»¶à£¬Èç¹ûÖ»ÊǽøÐÐSQL ServerÊý¾Ý¿âÖв¿·Ö±íµÄÒƶ¯£¬ÓÃÕâÖÖ·½·¨×îºÃ£¬µ±È»£¬Ò²¿ÉÒÔ½øÐÐÈ«²¿±íµÄÒƶ¯¡£ÔÚSQL Server Enterprise ManagerÖУ¬Õ¹¿ª·þÎñÆ÷×ó±ßµÄ+£¬Ñ¡ÔñÊý¾Ý¿â£¬ÓÒ»÷£¬Ñ¡ÔñAll tasks/I ......
1. Ö±½ÓÔÚPL/SQL ÖÐÐÞ¸ÄÊý¾Ý
selectÓï¾äºóÃæ¼Ó‘for updata’£¬´ò¿ª½çÃæÉϵÄСËø£¬±à¼£¬°´¹³¹³±£´æ¡£
eg: select * from xtgldxsyncdw for update; ²éѯ½á¹û´°¿ÚµÄСËø¼´¿É´ò¿ª¡£
2. µ¼È˵¼³ötables
tools -->import ......
SQL Server 2005 ûÓÐSQL Server Management Studio
°²×°visual studio 2005µÄʱºòϵͳҲװÁËSQL 2005¡£Çë×¢Ò⣬Õâʱ°²×°ÉϵÄSQL2005ÊÇExpress°æ±¾µÄ£¬¼È²»ÊÇÆóÒµ°æ£¬Ò²²»ÊÇ¿ª·¢Õß°æ¡£ÕâʱµÄExpress°æÊÇûÓа²×°SQL Server Management Studio µÄ£¬Ö»ÓÐÅäÖù¤¾ß£¬Ò²¾ÍÊÇ˵ÄãÔÚ¿ªÊ¼²Ëµ¥Ö»¿´µÃµ½ÅäÖù¤¾ß¡£
Õâʱ ......
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
¡¡¡¡SQL·ÖÀࣺ
¡¡¡¡DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
¡¡¡¡DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
¡¡¡¡DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
¡¡¡¡Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
¡¡¡¡1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
......
SQL code
SQL ServerÊý¾Ýµ¼Èëµ¼³ö¹¤¾ßBCPÏê½â
BCPÊÇSQL ServerÖиºÔðµ¼Èëµ¼³öÊý¾ÝµÄÒ»¸öÃüÁîÐй¤¾ß£¬ËüÊÇ»ùÓÚDB
-
LibraryµÄ£¬²¢ÇÒÄÜÒÔ²¢Ðеķ½Ê½¸ßЧµØµ¼Èëµ¼³ö´óÅúÁ¿µÄÊý¾Ý¡£BCP¿ÉÒÔ½«Êý¾Ý¿âµÄ±í»òÊÓͼֱ½Óµ¼³ö£¬Ò²ÄÜͨ¹ýSELECT fromÓï¾ä¶Ô±í»òÊÓͼ½øÐйýÂ˺󵼳ö¡£ÔÚµ¼Èëµ¼³öÊý¾Ýʱ£¬¿ÉÒÔʹÓÃĬÈÏÖµ»òÊÇʹÓÃÒ»¸ö¸ ......