bcp 可以实现数据的导入导出。
EXEC master..xp_cmdshell 'bcp test.dbo.P_Aspect in c:\temp1.txt -c -q -S"servername" -U"sa" -P""'
//导入 EXEC master..xp_cmdshell 'bcp test.dbo.P_Aspect out c:\temp1.txt -c -q -S"servername" -U"sa" -P""'
//导出

解决方案 »

  1.   

    请问在我的SQL-2000的查询器中可以直接使用吗???谢谢
      

  2.   

    EXEC master..xp_cmdshell 'bcp 库名.dbo.表名 out c:\temp1.txt -c -q -S"服务器名" -U"sa" -P"密码"'
      

  3.   

    bcp 实用工具
    bcp 实用工具在 Microsoft® SQL Server™ 2000 实例和数据文件之间以用户指定的格式复制数据。语法
    bcp {[[database_name.][owner].]{table_name | view_name} | "query"}
        {in | out | queryout | format} data_file
        [-m max_errors] [-f format_file] [-e err_file]
        [-F first_row] [-L last_row] [-b batch_size]
        [-n] [-c] [-w] [-N] [-V (60 | 65 | 70)] [-6]
        [-q] [-C code_page] [-t field_term] [-r row_term]
        [-i input_file] [-o output_file] [-a packet_size]
        [-S server_name[\instance_name]] [-U login_id] [-P password]
        [-T] [-v] [-R] [-k] [-E] [-h "hint [,...n]"]
      

  4.   

    bcp "Northwind.Jane Doe.Jane's Orders" out "Jane's Orders.txt" -c -q -U"Jane Doe" -P"go dba"bcp "Northwind.[Jane Doe].[Jane's Orders]" out "Jane's Orders.txt" -c -U"Jane Doe" -P"go dba"