Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : sqlserver

È«ÎÄË÷ÒýÔ­Àí¼°ÆäʾÀý£¨sqlserver£©

È«ÎļìË÷ÊǶԴóÊý¾ÝÎı¾½øÐÐË÷Òý£¬ÔÚ½¨Á¢µÄË÷ÒýÖжÔÒª²éÕҵĵ¥´Ê½øÐнøÐÐËÑË÷£¬¶¨Î»ÄÄЩÎı¾Êý¾Ý°üÀ¨ÒªËÑË÷µÄµ¥´Ê¡£Òò´Ë£¬È«ÎļìË÷µÄÈ«²¿¹¤×÷¾ÍÊǽ¨Á¢Ë÷ÒýºÍÔÚË÷ÒýÖÐËÑË÷¶¨Î»£¬ËùÓеŤ×÷¶¼ÊÇΧÈÆÕâÁ½¸öÀ´½øÐеġ£ÏÂÃæ¾ÍÖð¸ö½éÉÜ¡£
¡¡¡¡½¨Á¢È«ÎÄË÷ÒýÖÐÓÐÁ½Ïî·Ç³£ÖØÒª£¬Ò»¸öÊÇÈçºÎ¶ÔÎı¾½øÐзִʣ¬Ò»Êǽ¨Á¢Ë÷ÒýµÄÊý¾Ý½á¹¹¡£·Ö´ÊµÄ·½·¨»ù±¾ÉÏÊǶþÔª·Ö´Ê·¨¡¢×î´óÆ¥Åä·¨ºÍͳ¼Æ·½·¨¡£Ë÷ÒýµÄÊý¾Ý½á¹¹»ù±¾ÉϲÉÓõ¹ÅÅË÷ÒýµÄ½á¹¹¡£
¡¡¡¡·Ö´ÊµÄºÃ»µ¹Øϵµ½²éѯµÄ׼ȷ³Ì¶ÈºÍÉú³ÉµÄË÷ÒýµÄ´óС¡£ÔÚÖÐÎÄ·Ö´Ê·¢Õ¹ÖУ¬ÔçÆÚ¾­³£Ê¹Ó÷ִʷ½Ê½ÊǶþÔª·Ö´Ê·¨£¬¸Ã·½·¨µÄ»ù±¾Ô­ÀíÊǽ«°üº¬ÖÐÎĵľä×Ó½øÐжþÔª·Ö¸î£¬²»¿¼Âǵ¥´Êº¬Ò壬ֻ¶Ô¶þÔªµ¥´Ê½øÐÐË÷Òý¡£Òò´Ë¸Ã·½·¨Ëù·Ö³öµÄµ¥´ÊÊýÁ¿½Ï¶à£¬´Ó¶ø²úÉúµÄË÷ÒýÊýÁ¿¾Þ´ó£¬²éѯÖлὫÎÞÓõÄÊý¾Ý¼ìË÷³öÀ´£¬ºÃ´¦ÊÇËã·¨¼òµ¥²»»á©µô¼ìË÷µÄÊý¾Ý¡£Ö®ºóÓÖ·¢Õ¹³ö×î´óÆ¥Åä·Ö´Ê·½·¨£¬¸Ã·½·¨ÓÖ·ÖΪÕýÏò×î´ó·Ö´ÊºÍÄæÏò×î´ó·Ö´Ê¡£ÆäÔ­ÀíºÍ²é×ÖµäÀàËÆ£¬¶Ô³£Óõ¥´ÊÉú³ÉÒ»¸ö´Êµä£¬·ÖÎö¾ä×ӵĹý³ÌÖÐ×î´óµÄÆ¥Åä×ÖµäÖеĵ¥´Ê£¬´Ó¶ø½«¾ä×Ó²ð·ÖΪÓÐÒâÒåµÄµ¥´ÊÁ´¡£×î´óÆ¥Åä·¨ÖÐÕýÏò·Ö´Ê·½·¨¶ÔÆ«Õýʽ´ÊÓïµÄ·Ö±æÈÝÒײúÉú´íÎ󣬱ÈÈç“Ê×Êκͷþ×°”»á½«“ºÍ·þ”× ......

sqlserver bcpÃüÁ¿ìËÙ´¦Àí´óÊý¾Ý

bcpÃüÁîÊÇSQL ServerÌṩµÄÒ»¸ö¿ì½ÝµÄÊý¾Ýµ¼Èëµ¼³ö¹¤¾ß¡£Ê¹ÓÃËü²»ÐèÒªÆô¶¯ÈκÎͼÐιÜÀí¹¤¾ß¾ÍÄÜÒÔ¸ßЧµÄ·½Ê½µ¼Èëµ¼³öÊý¾Ý¡£bcpÊÇSQL ServerÖиºÔðµ¼Èëµ¼³öÊý¾ÝµÄÒ»¸öÃüÁîÐй¤¾ß£¬ËüÊÇ»ùÓÚDB-LibraryµÄ£¬²¢ÇÒÄÜÒÔ²¢Ðеķ½Ê½¸ßЧµØµ¼Èëµ¼³ö´óÅúÁ¿µÄÊý¾Ý¡£bcp¿ÉÒÔ½«Êý¾Ý¿âµÄ±í»òÊÓͼֱ½Óµ¼³ö£¬Ò²ÄÜͨ¹ýSELECT fromÓï¾ä¶Ô±í»òÊÓͼ½øÐйýÂ˺󵼳ö¡£ÔÚµ¼Èëµ¼³öÊý¾Ýʱ£¬¿ÉÒÔʹÓÃĬÈÏÖµ»òÊÇʹÓÃÒ»¸ö¸ñʽÎļþ½«ÎļþÖеÄÊý¾Ýµ¼Èëµ½Êý¾Ý¿â»ò½«Êý¾Ý¿âÖеÄÊý¾Ýµ¼³öµ½ÎļþÖÐ.
1. bcpµÄÖ÷Òª²ÎÊý½éÉÜ
bcp¹²ÓÐËĸö¶¯×÷¿ÉÒÔÑ¡Ôñ¡£
(1) µ¼Èë¡£
Õâ¸ö¶¯×÷ʹÓÃinÃüÁîÍê³É£¬ºóÃæ¸úÐèÒªµ¼ÈëµÄÎļþÃû¡£
(2) µ¼³ö¡£
Õâ¸ö¶¯×÷ʹÓÃoutÃüÁîÍê³É£¬ºóÃæ¸úÐèÒªµ¼³öµÄÎļþÃû¡£
(3) ʹÓÃSQLÓï¾äµ¼³ö¡£
Õâ¸ö¶¯×÷ʹÓÃqueryoutÃüÁîÍê³É£¬Ëü¸úoutÀàËÆ£¬Ö»ÊÇÊý¾ÝÔ´²»ÊDZí»òÊÓͼÃû£¬¶øÊÇSQLÓï¾ä¡£
(4) µ¼³ö¸ñʽÎļþ¡£
Õâ¸ö¶¯×÷ʹÓÃformatÃüÁîÍê³É£¬ºó¶ø¸ú¸ñʽÎļþÃû¡£
ÏÂÃæ½éÉÜһЩ³£ÓõÄÑ¡Ï
-f format_file
format_file±íʾ¸ñʽÎļþÃû¡£Õâ¸öÑ¡ÏîÒÀÀµÓÚÉÏÊöµÄ¶¯×÷£¬Èç¹ûʹÓõÄÊÇin»òout£¬format_file±íʾÒѾ­´æÔڵĸñʽÎļþ£¬Èç¹ûʹÓõÄÊÇformatÔò±íʾÊÇÒªÉú³ÉµÄ¸ñʽÎļþ¡£
-x
Õâ¸öÑ¡ÏîÒªºÍ-f format ......

¹ØÓÚupdateÓï¾äÔÚsqlserverºÍAccessÖеĶԱÈ

sqlserver£ºupdate Table_A set Table_A.col1 = (select Table_B.col1 from Table_B where Table_A.col2 = Table_B.col2)
Access: UPDATE Table_ A, Table_B SET Table_ A.×Ö¶Î2 = Table_ B.×Ö¶Î2
WHERE Table_ A.񅧏=Table_ A.񅧏;
×Ô¼º¼ÇÏ£¬ÌáÐÑ×Ô¼º ......

¹ØÓÚupdateÓï¾äÔÚsqlserverºÍAccessÖеĶԱÈ

sqlserver£ºupdate Table_A set Table_A.col1 = (select Table_B.col1 from Table_B where Table_A.col2 = Table_B.col2)
Access: UPDATE Table_ A, Table_B SET Table_ A.×Ö¶Î2 = Table_ B.×Ö¶Î2
WHERE Table_ A.񅧏=Table_ A.񅧏;
×Ô¼º¼ÇÏ£¬ÌáÐÑ×Ô¼º ......

Oracle´æ´¢¹ý³Ìת³ÉSqlserver´æ´¢¹ý³Ì

Oracle´æ´¢¹ý³Ìת³ÉSqlserver´æ´¢¹ý³Ì
1.ÈÕÆÚת»»
Oracle£º TO_NUMBER(TO_CHAR(SYSDATE, 'YYYYMMDD'))
SqlServer£ºCAST(CONVERT(CHAR(8),GETDATE(), 112) AS INT)
    ×¢£ºÆäÖБYYYYMMDD’¸ñʽ   ¶ÔÓ¦112
2.ROWIDת»»
Oracle£º ROWID
SqlServer: PRIMARY KEY(±íÖ÷¼ü)
3.ROWNUM
Oracle£º ROWNUM = 1
SqlServer£º Top 1
  ×¢£ºÒ»°ãSelectÖеÄÕâ¸ö¿ÉÒÔÖ±½ÓÌæ»»£¬µ«ÊÇÔÚUpdateÖоͱȽÏÄÑÁË£¬ÈçÏ£º
       Oracle£º UPDATE ITEM_MST SET
                       HISD_FLAG = 1
                   WHERE
                      ROWID = C2.ROWID;
       Sqlserver : UPDATE ITEM_MST SET
     &nbs ......

Oracle´æ´¢¹ý³Ìת³ÉSqlserver´æ´¢¹ý³Ì

Oracle´æ´¢¹ý³Ìת³ÉSqlserver´æ´¢¹ý³Ì
1.ÈÕÆÚת»»
Oracle£º TO_NUMBER(TO_CHAR(SYSDATE, 'YYYYMMDD'))
SqlServer£ºCAST(CONVERT(CHAR(8),GETDATE(), 112) AS INT)
    ×¢£ºÆäÖБYYYYMMDD’¸ñʽ   ¶ÔÓ¦112
2.ROWIDת»»
Oracle£º ROWID
SqlServer: PRIMARY KEY(±íÖ÷¼ü)
3.ROWNUM
Oracle£º ROWNUM = 1
SqlServer£º Top 1
  ×¢£ºÒ»°ãSelectÖеÄÕâ¸ö¿ÉÒÔÖ±½ÓÌæ»»£¬µ«ÊÇÔÚUpdateÖоͱȽÏÄÑÁË£¬ÈçÏ£º
       Oracle£º UPDATE ITEM_MST SET
                       HISD_FLAG = 1
                   WHERE
                      ROWID = C2.ROWID;
       Sqlserver : UPDATE ITEM_MST SET
     &nbs ......

MyEclipseÖÐÅäÖÃSQLServer 2005Êý¾Ý¿â


1.°²×°ºÃSQLServer 2005Êý¾Ý¿âÈí¼þ£¬½Ó×Å×îÖØÒªµÄ¾ÍÊÇ°²×°Êý¾Ý¿âÇý¶¯SQL Server 2005 driver for JDBC£¬¿ÉÒÔµ½:http://download.microsoft.com/download/8/B/D/8BDABAE2-B6EA-41D4-B903-7916EF3690EF/sqljdbc_1.2.2323.101_enu.exeÏÂÔØ
2.½«JDBC½âѹµ½ÈÎÒâµÄλÖã¬ÔÚ°²×°Ä¿Â¼ÀïÕÒµ½sqljdbc.jarÎļþ£¬ÒÔÇ°µÄÎÄÕÂÖÐÒѾ­½²¹ý»·¾³±äÁ¿µÄÅäÖã¬ÕâÀïÒª¼ÓÒ»µã£¬ÔÚclasspathÀïÔÙ¼ÓÉÏsqljdbc.jarµÄ·¾¶£¬±ÈÈçC:\Program Files\Java\sqljdbc_1.2\enu\sqljdbc.jar£»
3.ÉèÖÃSQLEXPRESS·þÎñÆ÷:
a.                               ´ò¿ªSQL Server Configuration Manager -> SQLEXPRESSµÄЭÒé -> TCP/IP
                         
b.                     &n ......

MyEclipseÖÐÅäÖÃSQLServer 2005Êý¾Ý¿â

1.°²×°ºÃSQLServer 2005Êý¾Ý¿âÈí¼þ£¬½Ó×Å×îÖØÒªµÄ¾ÍÊÇ°²×°Êý¾Ý¿âÇý¶¯SQL Server 2005 driver for JDBC£¬¿ÉÒÔµ½:http://download.microsoft.com/download/8/B/D/8BDABAE2-B6EA-41D4-B903-7916EF3690EF/sqljdbc_1.2.2323.101_enu.exeÏÂÔØ
2.½«JDBC½âѹµ½ÈÎÒâµÄλÖã¬ÔÚ°²×°Ä¿Â¼ÀïÕÒµ½sqljdbc.jarÎļþ£¬ÒÔÇ°µÄÎÄÕÂÖÐÒѾ­½²¹ý»·¾³±äÁ¿µÄÅäÖã¬ÕâÀïÒª¼ÓÒ»µã£¬ÔÚclasspathÀïÔÙ¼ÓÉÏsqljdbc.jarµÄ·¾¶£¬±ÈÈçC:\Program Files\Java\sqljdbc_1.2\enu\sqljdbc.jar£»
3.ÉèÖÃSQLEXPRESS·þÎñÆ÷:
a.                               ´ò¿ªSQL Server Configuration Manager -> SQLEXPRESSµÄЭÒé -> TCP/IP
                         
b.                     &nbs ......
×ܼǼÊý:341; ×ÜÒ³Êý:57; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [1] [2] [3] 4 [5] [6] [7] [8] [9] [10]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ