excelÊý¾Ýµ¼ÈëSQLSERVERÎÊÌâ
ÎÒÓÃ insert into table select * from '+
'OpenDataSource(''Microsoft.Jet.OLEDB.4.0'',''Data Source="'+opendialog1.FileName+'";User ID=;Password=;Extended Properties=Excel 8.0;Persist Security Info=False'')...sheet1$' ;
ʵÏÖexcelµÄÊý¾Ýµ¼Èëµ½SQL SERVERÀÓÐÒ»µã¸ã²»Ã÷°×£¬¾ÍÊÇ˵EXCELÀïÃæµÄ±íµÄ×ֶκÍSQL SERVERÀïÃæ±ítableµÄ×ֶαØÐëÒ»Ñù²ÅÄܵ¼ÈëÂð£¿Äܲ»ÄÜÔÚSQL SERVERÀïн¨Ò»¸ö±íµ¼È룬¾ßÌåµÄÓï¾äÔõÑùʵÏÖµÄÄØ£¬¸ÕѧdelphiºÜ¶àÎÊÌⶼ²»¶®¡£Ð»Ð»¸÷λ´óϺÁË
ÏòÄãÕâÖÖд·¨£¬×ֶξͱØÐëµÃÒ»Ò»¶ÔÓ¦£¬Èç¹ûÓÖ²»Ò»ÑùµÄ×ֶΣ¬Äã¾ÍÒªÖ¸Ã÷×Ö¶ÎÃû£¬±ÈÈç
insert into A(a,b,c) select d,e,f from B
LZµÄÎÊÌâ²»ÊÇDelphiÎÊÌ⣬ÊÇSQL²»ÊìÁ·
ÊÇ
Ïà¹ØÎÊ´ð£º
ÇëÎÊһϣ¬ÍâÍøÁ½Ì¨SQLSERVERʵÀýÊý¾Ý´«Ê䣬ÓÐûÓвÉÓÃÊý¾ÝѹËõºÍ¼ÓÃÜ¡£Ñ¹Ëõ±ÈÊǶàÉÙ£¬¼ÓÃÜÊÇʲô¼ÓÃÜËã·¨£¿Ïà¹ØÎĵµÄÄÀï¿ÉÒÔÕÒµ½£¿Ð»Ð»
ÎÒÒ²ÏëÖªµÀ£¡¹Ø×¢´ËÌù£¡
¹Ø×¢¡«¡«
Êý¾Ý¿â´óÅ£¶¼ÄÄÈ¥ÁË°¡£¿
......
import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class QueryTest&n ......
´ÓÍøÉϲ鵽µÄ×ÊÁÏ˵£¬ÈκÎÊý¾ÝÀàÐÍÓëNULLÖµ½øÐмÆË㣬½á¹û¶¼½«ÎªNULL.
select null-1
½á¹ûÊÇnull
¿ÉÊÇÏÂÃæÕâ¸ö²éѯΪʲô»á³ö´íÄØ£¿
select isnull(null-1,'test');
¾ÓÈ»±¨´í˵½«varcharתΪintʧ°Ü¡£
Ϊʲô» ......
asp.net²éѯSqlServer2005ÖÐtextÀàÐÍÊý¾Ý³£³£¶ªÊ§£¬Ìí¼ÓÊý¾Ýµ½textÀàÐÍÖп´Ò³ÃæÉÏ¿ÉÒÔ£¬ÓиöÒ»Á½Ì죬¾Í¿ÉÄÜ»á³öÏÖtext
Êý¾Ý´æµÄÊý¾ÝȱÉÙÒ»²¿·Ö£¬ÎªÊ²Ã´°¡£¡Çë´ó¼Ò°ï°ïæ°¡£¡
Óöþ½øÖÆ´æ·ÅËãÁË
²»Ã÷°×£¬ÄÜ×Ðϸ ......
¼ÙÉèÎÒµÄÊý¾Ý¿âÊÇ·ÅÔÚµçÄÔAÀ¶øÍøÕ¾·ÅÔÚµçÄÔBÀÄÇÎÒÏÖÔÚÒªÊÇÏ뱸·ÝµçÄÔAÉϵÄÊý¾Ý¿âµ½µçÄÔBµÄ´ÅÅÌÀÎÒ¸ÃÔõô×ö£¿Ï£Íû´ó¼Ò¸ø°ï°ï棬×îºÃÄܸø¸ödemo¡£ÎÒÓÊÏäÕ˺ţº952378159@qq.com ÏÈлл¸÷λÁË°¡£¡
ÓкܶàÖÖ· ......