There are various methods available for bulk
data operations.
- BCP
utility
- BULK
INSERT
- Using
OPENROWSET
- Import/Export
wizard
The BCP (Bulk Copy Program) utility is a command line that program that bulk-copies
data between a SQL instance and a data file using a special format file. The
BCP utility can be used to import large numbers of rows into SQL Server or
export SQL Server data into files. The BCP data files don’t include any schema
details or format information
BCP DatabaseName.SchemaName.[TableName |
ViewName] | Query
[IN
datafile | OUT datafile | queryout datafile |
format]
[Options]
First enble CMDSHELL
Use Master
GO
EXEC master.dbo.sp_configure 'show advanced options', 1
RECONFIGURE WITH OVERRIDE
GO
EXEC master.dbo.sp_configure 'xp_cmdshell', 1
RECONFIGURE WITH OVERRIDE
GO
EXEC master..xp_cmdshell 'BCP
[AdventureWorks2012].[Person].[Address] OUT c:\Person.xls -T -c'