Move table data to BCP file in E: drive

  • Hi My Database is filling very fast and due to this it creates problem.

    I have one more drive on the computer which is E: drive.I want to move some of my table data into E: drive BCP file..how can I do this..Please suggest me..

    I have come across one thing called partitioning...Can we move data to BCP files using Partitioning and how ..Please give me code...

  • There are many ways of extracting the data from a SQL Server table to Excel or a text file. Here are the options that you can chose from:

    1. Using DTS (SQL Server 2000) or SSIS (SQL Server 2005) – either through the Export/Import Wizard or through a custom package.

    2. BCP: Using BCP, you can extract the data out and dump it to an excel spreadsheet or a text file.

    3. Custom code written using SQL-DMO (SQL Server Distributed Management Objects) in SQL Server 2000 or SQL-SMO (SQL Server Management Objects) in SQL Server 2005.

    4. Directly through SQL Server Management Studio (Save Results AS).

    5. T-SQL:

    Check out:

    http://decipherinfosys.wordpress.com/2008/01/24/extracting-data-into-excel-or-text-file-from-sql-server/%5B/url%5D

    http://databases.about.com/od/sqlserver/a/bcp.htm

    Tanx 😀

  • Rightly said by Eswin, there are many ways.

    But i wanted to ask you one thing: if you want to move your data into BCP files and delete that data from the tables, you won't be able to access that data directly from TSQL. Is that what you want?

    -Vikas Bindra

  • yes I want to move data into my BCP file and delete it from table

    so that I can save space in my database...for furthur use ,I can copy those files any where or can Import data into database from BCP file...but Please tell me how to use bcp command to copy data from table to BCP file...I am using

    bcp LoggingStage.dbo.MyTable out "C:\inventory.txt" -c -T

    but It is not working in sql server

  • Try this one

    bcp LoggingStage.dbo.MyTable out "C:\inventory.txt" -n -T -S SERVERNAME

    replace SERVERNAME with the name of your server

    -Vikas Bindra

  • jain_abhishek (5/28/2009)


    Hi My Database is filling very fast and due to this it creates problem.

    I have one more drive on the computer which is E: drive.I want to move some of my table data into E: drive BCP file..how can I do this..Please suggest me..

    I have come across one thing called partitioning...Can we move data to BCP files using Partitioning and how ..Please give me code...

    You could extend the size of the SQL database by adding a database FILE to your E: drive:-

    right click on the database

    select Properties

    select Files

    click Add

    on the Path column, click ... and specify E:\path\filename

    should become obvious from there;-)

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply