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

sql serverµ¥±íµ¼Èë¡¢µ¼³ö£¨Í¨¹ýCSVÎļþ£©


µ¼³ö£º
Ö±½Ó´ò¿ª²éѯ·ÖÎöÆ÷²éѯҪµ¼³ö±íµÄÐÅÏ¢£¨select *  from ±í£©£¬µÃµ½µÄ½á¹ûÈ«Ñ¡£¬ÓÒ¼üÁí´æΪ xxx.csvÎļþ  £¨µÃµ½¸Ã±íµÄËùÓÐÐÅÏ¢£¬CSVÎļþ¸ñʽ£©
µ¼È룺
Ê×ÏÈͨ¹ýsql server µÄÆóÒµ¹ÜÀíÆ÷Éú³ÉÒªµ¼³ö±íµÄ SQL½Å±¾£¬²½Ö裺Ҫµ¼³ö±í——ËùÓÐÈÎÎñ£¨ÓÒ¼ü£©——Éú³ÉSQL½Å±¾
µÃµ½¸Ã±íµÄ½á¹¹£¬È»ºóÔÚÄ¿µÄÊý¾Ý¿âн¨¸Ã±í¡£
×îºóÒ»²½£ºÔÚ²éѯ·ÖÎöÆ÷ÀïÖ´ÐУºbulk insert ±íÃû from 'c:\xxx.csv' with(fieldterminator=',',rowterminator='\n') µ¼Èë³É¹¦


Ïà¹ØÎĵµ£º

º½¿Õ¹«Ë¾¹ÜÀíϵͳ(VC++ ÓëSQL 2005)

ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
      ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......

criteria µÄÓï¾ä¼ÓSQLÓï¾äÒ»Æð²éѯ

   if(query.getIsScrapAlert()!=null&&query.getIsScrapAlert()==1){
   //criteria.add(Expression.sql(" add_months(this_.D_RECEIVE_DATE,this_.N_DEPRECIABLE_LIFE*12)<add_months(sysdate,-3) "));
   criteria.add(Expression.sql(" ((add_months(this_. ......

sql sever °²×°Ê±Ä³¸ö³ÌÐò¹ÒÆð½â¾ö·½°¸

SQL server°²×°Ê±Ê±£º“ÒÔÇ°µÄij¸ö³ÌÐò°²×°ÒÑÔÚ°²×°¼ÆËã»úÉÏ´´½¨¹ÒÆðµÄÎļþ²Ù×÷¡£ÔËÐа²×°³ÌÐò֮ǰ±ØÐëÖØÐÂÆô¶¯¼ÆËã»ú”´íÎó¡£
´ò¿ª×¢²á±í±à¼­Æ÷£¨¿ªÊ¼->ÔËÐÐ->regedit£©£¬ÔÚHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session ManagerÖÐÕÒµ½PendingFileRenameOperationsÏîÄ¿£¬²¢É¾³ýËü¡£ÕâÑù ......

ÈÃÈË·¢¿ñµÄsqlÓï¾ä£¡

StringBuilder Asql = new StringBuilder();
            Asql.Append(" select '' as 'ÐòºÅ', T_Station.µµ°¸ºÅ,T_Station.StationName as '̨վÃû' , ");
            Asql.Append("  ÇøÕ¾ºÅ.ÇøÕ ......

SQLÓïÑÔ»ù´¡£¨2£©

from×Ó¾äÖ¸¶¨ÐèÒª½øÐÐÊý¾Ý²éѯµÄ±í£¬ÊÓͼµÈÊý¾ÝÔ´£¬ÓöººÅ·Ö¸ô¡£
from×Ӿ仹¿ÉÒÔÖ¸¶¨Êý¾Ý±í»òÊÓͼ֮¼äµÄÁ¬½ÓÀàÐÍ£¬ÀàÐÍÈ¡¾öÓÚon×Ó¾äÖÐÖ¸¶¨µÄÁ¬½ÓÌõ¼þ¡£
T-SQL¿ÉÒÔÖ§³ÖÔÚfrom×Ó¾äÖÐÖ¸¶¨³ýÊý¾Ý±í»òÊÓͼÍâµÄÆäËû¶ÔÏó¹¹³ÉÅÉÉú±í¡£
ÀýÈ磺select emp.Ô±¹¤±àºÅ£¬emp.Ô±¹¤ÐÕÃû£¬sp.²¿ÃÅÃû³Æ
      fr ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ