automation

sql

 bcp syntax arguments

optional bcp arguments

purge backup logs and shrink db

 

If you dont contribute to our content... 1.) you may get burnt  2.) you may stand on a toilette 3.) you may drop something 4.) you may take a shower!

 

We enjoy automation: Starting with the idea and concept of Bulk Copying Data to and from a sql server, whether it be 2000, 2005, or 2008. Bulk Copy Program: When you want to move a lot of data into or out of SQL server, you will likely find that the most efficient and best-performing tools are those that facilitate the bulk loading of data. The bulk loading tools are typically used to move data between flat files (e.g., a .csv file) and SQL Server, but it is possible to use the bulk copy operations with data sources other than flat files by using certain programming techniques. Regardless of what the data source is, though, the whole point of using the bulk copy tools is performance. Organizations use bulk loading techniques when they want to move a large number of rows as quickly as possible, and with as little impact on their servers as possible. Optimizing that performance can be a bit of an art, but we'll talk about some performance techniques at the end of this section. Before we get into performance, however, let's look at the first of the bulk load tools, BCP.

 

10/29/2009 Update: BCP example to pass a comma delimited line from a text file to a database. Terminator is space.

example file format (filename.txt): one,10/29/2009 2:06:36 PM,info

example command: bcp Database.dbo.Table in Filename.txt -SServerName -T -c -r\, -t,

Syndicate content