本帖最后由 Journey_ZZ 于 2011-04-12 15:48:39 编辑

解决方案 »

  1.   

    就这样写入???--> 测试数据:[TB]
    if object_id('[TB]') is not null drop table [TB]
    create table [TB]([col1] int,[col2] varchar(10),[col3] int)
    insert [TB]
    select 12334,'xj77334245',36066316 union all
    select 12333,'xj35822317',28682165 union all
    select 12332,'xj67832286',26574366 union all
    select 12331,'xj15427944',74060125 union all
    select 12330,'xj97145116',56778287 union all
    select 12329,'xj54634388',37403046 union all
    select 12328,'xj20628465',89361545 union all
    select 12327,'xj77216647',61986394 union all
    select 12326,'xj50832486',28574566 union all
    select 12325,'xj32550567',91282638 union all
    select 12324,'xj17127224',67759395 union all
    select 12323,'xj80835486',58577566 union all
    select 12322,'xj29148317',88781487 union all
    select 12321,'xj71816816',54775664 union all
    select 12320,'xj52632665',12364746 union all
    select 12319,'xj10129837',83989595 union all
    select 12318,'xj82835686',41577767 union all
    select 12317,'xj80625464',59357545 union all
    select 12316,'xj29831718',13691566 union all
    select 12315,'xj59134739',42814486 union all
    select 12314,'xj34139825',84762086 union all
    select 12313,'xj64343846',23075917 union all
    select 12312,'xj46151018',15693188 union all
    select 12311,'xj04546767',63288837 union all
    select 12310,'xj04346847',53988917 union all
    select 12309,'xj52834018',45604766 union all
    select 12308,'xj34559767',93282838 union all
    select 12307,'xj82147930',74817687 union all
    select 12306,'xj67132126',26775286select * from [TB]
      

  2.   

    如果是文本文件中的内容,可以考虑
    /** 导入文本文件 
    EXEC master..xp_cmdshell 'bcp dbname..tablename in c:\DT.txt -c -Sservername -Usa -Ppassword' 
      

  3.   


    //现有数据(1W条左右)的排列格式如下:
    ID    卡号         密码
    12330 xj97145116 56778287
    12329 xj54634388 37403046
    12328 xj20628465 89361545
    12327 xj77216647 61986394
    12326 xj50832486 28574566
    12325 xj32550567 91282638
    12324 xj17127224 67759395
    12323 xj80835486 58577566//要导入的[Info]表结构如下:
    [ID]   [卡号]    [密码]   [等其他字段]//请问怎么让导入到这个[Info]表中
      

  4.   

    在企业管理器页面import data datasource选flat file source,filename选要导入的文件,columns选项的column delimiter 里输入你的分隔符,就行了
      

  5.   

    可以直接CTRL+C  CTRL+V  不过可能速度比较慢  或者 拷到EXCEL中 批量弄成INSERT语句 然后执行
      

  6.   

    使用BCP导出整个表或视图。 BCP AdventureWorks.sales.currency out c:\currency1.txt -c -U"sa" -P"password" --使用密码连接 或 BCP AdventureWorks.sales.currency out c:\currency1.txt -c -T --使用信任连接 下面是上述命令执行后的输出结果 Starting copy... 
    105 rows copied. 
    Network packet size (bytes): 4096 
    Clock Time (ms.) Total : 10 Average : (10500.00 rows per sec.) 下面是currency1.txt的部分内容 AED Emirati Dirham 1998-06-01 00:00:00.000 
    AFA Afghani 1998-06-01 00:00:00.000 
    ... ... ... 
    ... ... ... 
    ZWD Zimbabwe Dollar 1998-06-01 00:00:00.000 在使用密码登录时需要将-U后的用户名和-P后的密码加上双引号。 注:BCP除了可以在控制台执行外,还可以通过调用SQL Server的一个系统存储过程xp_cmdshell以SQL语句的方式运行BCP。如上述第一条命令可改写为 EXEC master..xp_cmdshell 'BCP AdventureWorks.sales.currency out c:\currency1.txt -c -U"sa" -P"password"'  
    执行xp_cmdshell后,返回信息以表的形式输出。为了可以方便地在SQL中执行BCP,下面的命令都使用xp_cmdshell执行BCP命令。
      

  7.   

    轻轻松松SSIS,数据导入导出功能完成。
      

  8.   

    create table tab1
    (
    col1 nvarchar(20),
    col2 nvarchar(20),
    col3 nvarchar(20)
    )go
    -- bulk insert 以用户指定的格式复制一个数据文件至数据库表或视图中
    bulk insert tab1 from "C:\abc.txt"
    /*
    ----abc.txt文件中存放了数据
    12334 xj77334245 36066316
    12333 xj35822317 28682165
    12332 xj67832286 26574366
    12331 xj15427944 74060125
    12330 xj97145116 56778287
    12329 xj54634388 37403046
    12328 xj20628465 89361545
    12327 xj77216647 61986394
    12326 xj50832486 28574566
    12325 xj32550567 91282638
    12324 xj17127224 67759395
    */
      

  9.   

    copy to excel,then read excel