Ôõô½«excel2003Êý¾ÝÓÐÑ¡ÔñµÄµ¼Èëµ½ sqlserver!!!
2002Äê5ÔÂÖ°¹¤»¨Ãû²á
ÐòºÅ ÐÕÃû ÐÔ±ð Ãñ×å ¹¤×Ê
1 ÕÅÈý ÄÐ ºº 800.00
2 ÀîËÄ ÄÐ »Ø 1200.00
3 ÕÅÜ¿ Å® ºº 852.00
4 ºÎÌìÈÙ ÄÐ Âú 962.00
ÀýÈçÉÏÃæÎÒÖ»ÒªÊý¾Ý£¬¶ø²»Òª±êÌâºÍÁÐÃû
SQL code:
SELECT * into newtable from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0','Data Source="d:\book1.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...[a1$]
ÉÏÃæÕâ¸ö²»ÐÐ
ллÁË£¬ÎÒÖ»ÓÐÕâô¶à·ÖÁË
1.°ÑÊý¾ÝÈ«²¿µ¼Èëµ½Ò»¸öÁÙʱ±í.
2.¸ù¾ÝÄãµÄÌõ¼þÑ¡ÔñÄãÐèÒªµÄÊý¾Ý.
½¨Á¢Ò»¸ö±ítable£¨Ïàͬ½á¹¹µÄ±í£©
½«ÒÔÉÏÓï¾äµ¼Èë±ítable
SQL code:
insert into table
SELECT * from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0','Data Source="d:\book1.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...[a1$]
ÒªÊÇ»¹²»ºÃʹµÄ»°£»¿ÉÒÔÊÔ×ÅÓÃSSISÀ´¡£¡£
Ö±½ÓÓÃÊý¾Ýµ¼È빦ÄÜ£¬ÀïÃæ¿ÉÒÔÉèÖÃÌõ¼þ
ÎÒÏëÓóÌÐòʵÏÖ£¬¿´À´ÊÇû°ì·¨ÁË£¬½áÌû
Ïà¹ØÎÊ´ð£º
ÓÐһ̨Êý¾Ý¿â·þÎñÆ÷£¬¿Í»§¶ËʹÓÃADO.NETÁ¬½Ósql£¬Ê¹ÓÃExecuteScalarÖ´ÐÐSQL INSERTÓï¾ä£¬È»ºó¿Í»§¶Ëˢв»Äܲéѯµ½ÐÂINSERTµÄÊý¾Ý£¬¹ý10Ãë×óÓÒ²ÅÄܲ鵽ÐÂÊý¾Ý
ʲôÔÒò
Äã×öÁË»º´æÂð£¿
û×ö»º´æ
Ôõô»áÄØ£¡ ......
ÈçºÎ½«SqlServerÊý¾Ý¿âÖеÄÊý¾Ýµ¼Èëµ½ExcelÖУ¿
ÓÃsql server ×Ô´øµÄ¹¤¾ß
ÒýÓÃ
ÓÃsql server ×Ô´øµÄ¹¤¾ß
SQL²éѯ·ÖÎöÆ÷
DTSµ¼Èëµ¼³öÊý¾Ý
¿ÉÒÔÓÃSqlServer×Ô´øµÄ¹¤¾ß
ËùÓÐÈÎÎñ£µ¼³öÊý¾Ý¡£
ÄãÏÈÓòéÑ ......
ÈçºÎ½«SqlServerÊý¾Ý¿âÖеÄÊý¾Ýµ¼Èëµ½ExcelÖУ¿
Ñ¡ÔñÊý¾Ý¿â£¬µã»÷ÓÒ¼ü ÈÎÎñ->µ¼³öÊý¾Ý Ö®ºó°´ÕÕÌáʾµ¼³ö¾Í¿ÉÒÔÁË£¡
±í¶àµÄ»° ÓÃÂ¥Éϵķ½·¨ ±È½Ï·½±ã ¿ÉÒÔ°ÑÊý¾Ý¿âÀïÏàÓ¦µÄ±íµ¼³ö »òÕßÈç¹ûÄãÊDzéѯ³öÀ´µÄ ......
ÒÔÏ´úÂëÊÇÌí¼ÓÊý¾Ý°´Å¥µÄ´úÂ룬Ïë°Ñtestid£¬ºÍtestnameÁ½¸ötxt´«µÝµ½Êý¾Ý¿âÖÐ
Êý¾Ý¿âÁ¬½Ó¿Ï¶¨Ã»ÎÊÌâ
¾ÍÊǺìÉ«²¿·ÖÀϱ¨´í
²»ÖªµÀΪʲô-£¬-
Çë¸÷λ¸ßÈË°ïæ¿´¿´£¡
лл£¡
Java code:
private void new ......