WEB开发网
开发学院数据库MSSQL Server SQL Server数据导入导出的几种方法 阅读

SQL Server数据导入导出的几种方法

 2010-06-25 00:00:00 来源:WEB开发网   
核心提示: 4.BULK INSERT. T-SQL的命令,允许直接导入数据 语法: BULK INSERT语法BULKINSERT[database_name.[schema_name].|schema_name.][table_name|view_name]FROM'data_file'

4.BULK INSERT. T-SQL的命令,允许直接导入数据

语法:  

BULK INSERT语法

BULK INSERT 
  [ database_name. [ schema_name ] . | schema_name. ] [ table_name | view_name ] 
   FROM 'data_file' 
   [ WITH 
  ( 
  [ [ , ] BATCHSIZE =batch_size ] 
  [ [ , ] CHECK_CONSTRAINTS ] 
  [ [ , ] CODEPAGE = { 'ACP' | 'OEM' | 'RAW' | 'code_page' } ] 
  [ [ , ] DATAFILETYPE = 
   { 'char' | 'native'| 'widechar' | 'widenative' } ] 
  [ [ , ] FIELDTERMINATOR = 'field_terminator' ] 
  [ [ , ] FIRSTROW = first_row ] 
  [ [ , ] FIRE_TRIGGERS ] 
  [ [ , ] FORMATFILE ='format_file_path' ] 
  [ [ , ] KEEPIDENTITY ] 
  [ [ , ] KEEPNULLS ] 
  [ [ , ] KILOBYTES_PER_BATCH =kilobytes_per_batch ] 
  [ [ , ] LASTROW =last_row ] 
  [ [ , ] MAXERRORS =max_errors ] 
  [ [ , ] ORDER ( { column [ ASC | DESC ] } [ ,...n ] ) ] 
  [ [ , ] ROWS_PER_BATCH =rows_per_batch ] 
  [ [ , ] ROWTERMINATOR ='row_terminator' ] 
  [ [ , ] TABLOCK ] 
  [ [ , ] ERRORFILE ='file_name' ] 
  )] 

重要参数:

FIELDTERMINATOR,字段分隔符

FIRSTROW:第一个数据行

上一页  1 2 3 4  下一页

Tags:SQL Server 数据

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接