½«ExcelµÄÊý¾Ýµ¼Èëµ½SQL 2005ÏÖÓеıíÖÐ
ÎÒÔÚ½«ExcelµÄÊý¾Ýµ¼Èëµ½SQLµÄʱºòÀÏÊdzöÏÖÏÂÃæµÄ´íÎó£º
ÅäÖÃÑ¡Ïî 'show advanced options' ÒÑ´Ó 1 ¸ü¸ÄΪ 1¡£ÇëÔËÐÐ RECONFIGURE Óï¾ä½øÐа²×°¡£
ÅäÖÃÑ¡Ïî 'Ad Hoc Distributed Queries' ÒÑ´Ó 1 ¸ü¸ÄΪ 1¡£ÇëÔËÐÐ RECONFIGURE Óï¾ä½øÐа²×°¡£
ÏûÏ¢ 7399£¬¼¶±ð 16£¬×´Ì¬ 1£¬µÚ 1 ÐÐ
Á´½Ó·þÎñÆ÷ "(null)" µÄ OLE DB ·ÃÎÊ½Ó¿Ú "MICROSOFT.JET.OLEDB.4.0" ±¨´í¡£Ìṩ³ÌÐòδ¸ø³öÓйشíÎóµÄÈκÎÐÅÏ¢¡£
ÏûÏ¢ 7303£¬¼¶±ð 16£¬×´Ì¬ 1£¬µÚ 1 ÐÐ
ÎÞ·¨³õʼ»¯Á´½Ó·þÎñÆ÷ "(null)" µÄ OLE DB ·ÃÎÊ½Ó¿Ú "MICROSOFT.JET.OLEDB.4.0" µÄÊý¾ÝÔ´¶ÔÏó¡£
ÎÒ½«´úÂëÌù³öÀ´£¬Íû´ó¼Ò°ïæָµãһϰ¡£¡·Ç³£¸Ðл£¡
/// <summary>
/// ´ò¿ªÎļþ
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button2_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.ShowDialog();
ofd.Filter = "Excel Îļþ(*.xls)|";
ofd.ValidateNames = true;
ofd.CheckPathExists = true;
ofd.CheckFileExists = true;
string filepath = ofd.FileName;
this.textBox1.Text = filepath;
}
public void ExecMothod()
{
&nb
Ïà¹ØÎĵµ£º
--------------------------------------------------------------------------
-- Author : ÔÖø£º²»Ïê ¸Ä±à£ºhtl258(Tony)
-- Subject: ÍêÉÆSQLÅ©Àúת»»º¯Êý£¨ÏÔʾÖÐÎĸñʽ£¬¼ÓÈëÈóÔµÄÏÔʾ£©
-------------------------------------------------------------------------- ......
insert into OPENROWSET('MICROSOFT.JET.OLEDB.4.0'
,'Excel 8.0;HDR=YES;DATABASE=c:\test.xls',sheet1$)
select * from ±íÃû
Èç¹ûÊÇÉú³Éexcel時ÓÃbcp
--µ¼³ö²éѯµÄÇé¿ö
EXEC master..xp_cmdshell 'bcp "SELECT au_fname, au_lname from pubs..authors ORDER BY au_lname" queryout "c:\test.xls" /c -/S"·þÎ ......
select * from ((select bill.id billId,bach.riskRate risk,bach.assureRate assure from AcptBillInfo bill,AcptBach bach where bill.acptBatchId=bach.id and bill.rgctId=? )abach left outer join AcptSignMoney sig on abach.billId = sig.billId) ......
ÔÚ¼¤ÁÒµÄÊг¡¾ºÕù»·¾³Ï£¬ÉÌÈ˶ÔÊг¡»·¾³µÄ°ÑÎպ;ö²ßÖ±½Ó¹Øϵµ½Êг¡µÄÇ÷ÊƺͻúÓö£¬¶Ô¿Í»§ÐèÇóµÄ¿ìËÙÏàÓ¦Äܹ»Õ¼¾¡Êг¡µÄÏÈ»ú¡£ÔÚµ±½ñÉç»áµÄÈÕ³£ÉÌÎñ»î¶¯ÖУ¬ÒÔÍù»ýÀÛµÄÏà¹ØÉÌÒµÊý¾ÝÄܹ»ÎªºóÐøµÄÒµÎñ»î¶¯ÌṩÁ¼ºÃµÄ²Î¿¼ºÍÏòµ¼¡£ÔçÔÚ10ÓàÄêÇ°£¬ÉÌÒµÖÇÄÜ£¨Business Intelligence£¬Ï³ÆBI£©³§É̾ÍÒѾ ......