Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

sqlserver 2005 µ¼³öÊý¾Ý

°Ñµ±Ç°Êý¾Ý¿âÖбíµÄÊý¾Ý µ¼³É insert into Óï¾ä

±ÈÈç µ±Ç°Êý¾Ý¿âÖÐÓÐÒ»°ÙÌõÊý¾Ý 

ÎÒÈçºÎÄÜ ÈÃSqlServer ×Ô¶¯´´½¨Ò»°Ù¸ö insert into Óï¾ä

µ±È» ÓÐ union  Ò²¿ÉÒÔ

Âé·³¸÷λ°ï°ïæÁË 

SQL code:
SELECT * INTO TB from TBB
?

ÓбØÒªÕâÑùÂ𡣡£

Ôõô×öµ½ÄØ

µ¼³ÉÍⲿµÄÎļþ 

ÒýÓÃ
°Ñµ±Ç°Êý¾Ý¿âÖбíµÄÊý¾Ý µ¼³É insert into Óï¾ä

±ÈÈç µ±Ç°Êý¾Ý¿âÖÐÓÐÒ»°ÙÌõÊý¾Ý 

ÎÒÈçºÎÄÜ ÈÃSqlServer ×Ô¶¯´´½¨Ò»°Ù¸ö insert into Óï¾ä

µ±È» ÓÐ union  Ò²¿ÉÒÔ

Âé·³¸÷λ°ï°ïæÁË 


100ÐÐÊý¾Ý£¬100¸öinsert£¿
Èç¹ûlzÒªµ¼ÈëÊý¾ÝµÄ»°£¬ÅúÁ¿Ò²¾Í¿ÉÒÔÁË°¡£¡
Ò»ÌõÒ»¸öinsert£¬Ã»ÓбØÒªµÄ˵...

ÎÒÒªµ¼³ÉÍⲿµÄÎļþ  ´ò°üµÄʱºò ʹÓà ½Å±¾´´½¨Êý¾Ý¿â  ´´½¨±í  ²åÈëÊý¾Ý

ÒýÓÃ
µ¼³ÉÍⲿµÄÎļþ 

????

http://blog.csdn.net/feixianxxx/archive/2009/07/21/4365576.aspx

ÔÚÒ»¸öÎļþÖÐ º¬ÓÐ
insert into values ····

È»ºó´ò°ü  °²×°µÄÊÇ Ö´ÐÐ ÕâЩÓï¾ä

EXEC master..xp_cmdshell 'BCP NTS.dbo.T_User out c:\User.txt -c -U"sa" -P"password"'

¼òµ¥µÄ



Ïà¹ØÎÊ´ð£º

ado·ÃÎÊÔ¶³ÌÊý¾Ý¿â(Ô¶³Ì·ÃÎÊsqlserver)

ÊÇÕâÑùµÄ£¬ÎÒÓÃÊÇODBCÊý¾ÝÔ´Á¬½Ó·þÎñÆ÷µÄÊý¾Ý¿â£¬ÏÖÔÚÎÒ¾õµÃºÜÂé·³£¬ÒòΪҪΪÿÈç»úÌí¼Ó¶ÔÓ¦µÄÊý¾ÝÔ´£¬Ïë°ÑËû¸Ä³ÉADO·½·¨À´·ÃÎÊ·þÎñÆ÷µÄÊý¾Ý¿âÄÜʵÏÖÂð£¿ÒªÔõôд¡£
±ÈÈç·þÎñÆ÷ÀïÓжþ¸öÊý¾Ý¿âdata1 ºÍdata2£¬¿Í»§ ......

sqlserverÈ«ÎÄË÷ÒýµÄÔ­Àí

ÎÒ¿´Á˺ܶàÎÄÕ£¬Ð´µÄ̫רҵ£¬Äܲ»ÄÜÓôó°×»°½²½²£¬¾ÍÊÇÔõô¹¹½¨Ë÷ÒýµÄ£¬²éµÄʱºòÊÇÔõôÑùµÄ²½Ö裬Ϊʲô±Èlike¿ì£¬ÊDz»ÊÇÖ»ÒªÓÃcontect£¬¾ÍÒ»¶¨»áÈ¥²é£¬±ÈÈç
select * from table where contect('sdfsd',sdf) and ......

sqlserverÖбêʶÖÖ×Ó¡¢±êʶºÍ¹«Ê½µÈµÄº¬Òå

sqlserverÖж¨Òå×Ö¶Îʱ£¬ÓбêʶÖÖ×Ó¡¢±êʶºÍ¹«Ê½µÈ£¬ÊÇʲôÒâ˼£¿
Ó¦¸Ã˵µÄÊÇidentity°É

identity?ɶÒâ˼£¿

IDENTITY£¨º¯Êý£©
Ö»ÓÃÔÚ´øÓÐ INTO table ×Ó¾äµÄ SELECT Óï¾äÖУ¬ÒÔ½«±êʶÁвåÈ뵽бíÖС£
¾¡¹ ......

Á¬½ÓSqlServerʱ±¨´í£¡£¡£¡

Óû§´úÂëδ´¦Àí System.Data.SqlClient.SqlException
  Message="¶ÔÏóÃû  'SUS_CustomersRegister' ÎÞЧ¡£"
  Source=".Net SqlClient Data Provider"
  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ