MS SQL server data dump

Ways to dump database content:

  1. DTS or SSIS
  2. bcp


You may use bcp command to dump database content to text file.


SET @cmd = 'bcp "select * from mytable where {your condition} ORDER BY {sorting}"'
               + ' queryout Z:\outputfilename' + '.TXT -c -Sservername -Uusername -Ppassword'
EXEC @rc = master..xp_cmdshell @cmd



Comments

Popular Posts