1/******* 导出到 excelEXEC master
xp_cmdshell ’bcp SettleDB
shanghu out c:temp1
xls -c -q -S"GNETDATA/GNETDATA" -U"sa" -P""’/*********** 导入 ExcelSELECT *FROM OpenDataSource( ’Microsoft
0’,’Data Source= "c:test
xls";User ID= Admin;Password= ;Extended properties= Excel 5
xactionsSELECT cast(cast(科目编号 as numeric(10,2)) as nvarchar(255))+’’ 转换后的别名FROM OpenDataSource( ’Microsoft
0’,’Data Source= "c:test
xls";User ID= Admin;Password= ;Extended properties= Excel 5
xactions/** 导入文本文件EXEC master
xp_cmdshell ’bcp "dbname
tablename" in c:DT
txt -c -Sservername -Usa -Ppassword’/** 导出文本文件EXEC master
xp_cmdshell ’bcp "dbname
tablename" out c:DT
txt -c -Sservername -Usa -Ppassword’或EXEC master
xp_cmdshell ’bcp "Select * from dbname
tablename" queryout c:DT