SQLServer´óÊý¾ÝÁ¿²åÈëBULK INSERT
SQLSERVER ´óÊý¾ÝÁ¿²åÈëÃüÁ
BULK INSERTÊÇSQLSERVERÖÐÌṩµÄÒ»Ìõ´óÊý¾ÝÁ¿µ¼ÈëµÄÃüÁËüÔËÓÃDTS(SSIS)µ¼ÈëÔÀí£¬¿ÉÒÔ´Ó±¾µØ»òÔ¶³Ì·þÎñÆ÷ÉÏÅúÁ¿µ¼ÈëÊý¾Ý¿â»òÎļþÊý¾Ý¡£ÅúÁ¿²åÈëÊÇÒ»¸ö¶ÀÁ¢µÄ²Ù×÷£¬ÓŵãÊÇЧÂʷdz£¸ß¡£È±µãÊdzöÏÖÎÊÌâºó²»¿ÉÒԻعö¡£
¡¡¡¡BULK INSERTÊÇÓÃÀ´½«ÍⲿÎļþÒÔÒ»ÖÖÌض¨µÄ¸ñʽ¼ÓÔص½Êý¾Ý¿â±íµÄT-SQLÃüÁî¡£¸ÃÃüÁîʹ¿ª·¢ÈËÔ±Äܹ»Ö±½Ó½«Êý¾Ý¼ÓÔص½Êý¾Ý¿â±íÖУ¬¶ø²»ÐèҪʹÓÃÀàËÆÓÚIntegration ServicesÕâÑùµÄÍⲿ³ÌÐò¡£ËäÈ»BULK INSERT²»ÔÊÐí°üº¬Èκθ´ÔÓµÄÂß¼»òת»»£¬µ«Äܹ»ÌṩÓë¸ñʽ»¯Ïà¹ØµÄÑ¡Ï²¢¸æËßÎÒÃǵ¼ÈëÊÇÈçºÎʵÏֵġ£BULK INSERTÓÐÒ»¸öʹÓÃÏÞÖÆ£¬¾ÍÊÇÖ»Äܽ«Êý¾Ýµ¼ÈëSQL Server¡£
²åÈëÊý¾ÝÏÂÃæµÄÀý×ÓÄÜÈÃÎÒÃǸüºÃµÄÀí½âÈçºÎʹÓÃBULK INSERTÃüÁî¡£Ê×ÏÈ£¬ÎÒÃÇÀ´´´½¨Ò»¸öÃûΪSalesµÄ±í£¬ÎÒÃǽ«Òª°ÑÀ´×ÔÎı¾ÎļþµÄÊý¾Ý²åÈëµ½Õâ¸ö±íÖС£
±¾µØÊý¾Ý²Ù×÷£º
µ±ÎÒÃÇʹÓÃBULK INSERTÃüÁîÀ´²åÈëÊý¾Ýʱ£¬´´½¨µÄ±íÓÐÎÞ´¥·¢Æ÷ÐèÒª²»Í¬µÄÅäÖã¬ÎÒÃÇ·Ö±ð¾ÙÀýÀ´¿´£º
¡¾AûÓд¥·¢Æ÷µÄ±í¡¿
¡¡¡¡CREATE TABLE [dbo].[Sales]
¡¡¡¡(
¡¡¡¡ [SaleID] [int],
¡¡¡¡ [Product] [varchar](10) NULL,
¡¡¡¡ [SaleDate] [datetime] NULL,
¡¡¡¡ [SalePrice] [money] NULL
¡¡¡¡)
¡¾BÓд¥·¢Æ÷µÄ±í¡¿
¡¡¡¡»¹ÊÇÔÚÉÏÃæ±íµÄ»ù´¡ÉÏ£¬ÎÒÃÇ´´½¨´¥·¢Æ÷£¬ÓÃÀ´´òÓ¡²åÈëµ½±íÖеļǼµÄÊýÁ¿¡£
¡¡¡¡CREATE TRIGGER tr_Sales
¡¡¡¡ON Sales
¡¡¡¡FOR INSERT
¡¡¡¡AS
¡¡¡¡BEGIN
¡¡¡¡PRINT CAST(@@ROWCOUNT AS VARCHAR(5)) + ' rows Inserted.'
¡¡¡¡END
ÕâÀïÎÒÃÇÑ¡ÔñÎı¾Îļþ×÷ΪԴÊý¾ÝÎļþ£¬Îı¾ÎļþÖеÄֵͨ¹ý¶ººÅ·Ö¸î¿ª¡£¸ÃÎļþ°üº¬1000Ìõ¼Ç¼£¬¶øÇÒÆä×ֶκÍSales±íµÄ×Ö¶ÎÖ±½Ó¹ØÁª¡£ÓÉÓÚ¸ÃÎı¾ÎļþÖеÄÖµÊÇÓɶººÅ·Ö¸î¿ªµÄ£¬ÎÒÃÇÖ»ÐèÒªÖ¸¶¨FIELDTERMINATOR¼´¿É¡£×¢Ò⣬µ±ÏÂÃæÕâÌõÓï¾äÔËÐÐʱ£¬ÎÒÃǸոմ´½¨µÄ´¥·¢Æ÷²¢Ã»ÓÐÆô¶¯£º
A£ºÃ»Óд¥·¢Æ÷µÄ²Ù×÷
BULK INSERT Sales from 'C:\Users\Administrator\Desktop\Sales.txt' WITH (FIELDTERMINATOR = ',')
B£ºÓд¥·¢Æ÷µÄ²Ù×÷
¡¡¡¡µ±ÎÒÃÇÒªµÄÊý¾ÝÁ¿·Ç³
Ïà¹ØÎĵµ£º
1.oracle»·¾³
create table test
(
id number(4),
name varchar2(20)
)
ÔÚÒ»¸ösessionÖÐ
insert into test values(1,'aa');
ÔÚÁíÒ»¸ösessionÖÐ
select * from test1;
²éѯû±»×èÈû
2.sqlserver»·¾³
ÔÚÒ»¸ösessionÖÐ
insert into test values(1,'aa');
ÔÚÁíÒ»¸ösessionÖÐ
select * from test1;
²éѯ±»×èÈû(Ê ......
ÒòΪ¹¤×÷ÐèÒª£¬Êý¾Ý¿âʹÓõÄMS SQL Server2005£¬¶øĬÈϵÄÅÅÐò¹æÔòÊÇSQL_Latin1_General_CP1_CI_AS¡£´´½¨ÁËÒ»¸ö±í£¬ÒòΪÐèÒª´æ´¢ÖÐÎÄÐÅÏ¢£¬Address×ֶεÄÀàÐÍÊÇnvarchar(255)¡£
´ËʱʹÓÃphpÀ´Á¬½Ósql server£¬Ò³ÃæµÄ±àÂëºÍÎļþµÄ±àÂ붼ÊÇUTF-8£¬²éѯ´ËAddress×ֶΣ¬ÏÔʾÔÚÒ³ÃæÉÏÊÇ???Ö®ÀàµÄ¡£Ôõô½â¾ö£¿
ʹÓÃ
iconv('iso- ......
ÏÂÎçÐèÒªÅäÖñ¾»ú°²×°µÄmssqlÊý¾Ý¿âÄܹ»ÔÚÔ¶³Ì·ÃÎÊ£¬ÔÚÍøÉÏËÑË÷µÄ·½·¨£ºhttp://weste.net/2009/5-20/21244518910.html
°´ÕÕÕâ¸ö²½ÖèÒ»²½Ò»²½ÅäÖÃÏÂȥȴ·¢ÏÖÈÔÈ»²»ÄÜ·ÃÎÊ¡£Èç¹ûÅäÖÃprotocolµÄʱºòlisten all ÉèÖÃΪno£¬ÖØÆômssql·þÎñϵͳ»áÌáʾmssql·þÎñ×Ô¶¯Í£Ö¹£»Èç¹ûÉèÖÃΪyes¿ÉÒÔÆô¶¯È´ÔÚnetstatÁбíÖÐÎÞ·¨¼ì²éµ½¶Ô1433¶ ......
function db()
{
//»î¶¯±àºÅ
var activeid = Request.Form("activeid");
//̞
var username = Request.Form("username");
//ÊÖ»úºÅÂë
var mobile = Request.Form("mobile");
var conn= Server.CreateObject("ADODB.connection");
var rs= Serve ......
¼Ç¼һÏÂÒÔ±¸Ï´οìËÙÕÒµ½¡£¡£¡£
Íùtb_wf_privgrant±íÖвåÈëÒ»Ìõ¼Ç¼£¬workflow_id×Ö¶ÎÖµ´Ótb_wf_workflow ±íÖлñÈ¡workflow_name='֪ʶÉóºË'µÄËùÓмǼÖÐworkflow_id×î´óÖµ¡£
--oracle
declare a NUMBER(10);
begin
select max(wo ......