how to backup and restore only a table?

  • Hello,

    Is there any way just to backup a table (big table) and restore it on different server (different location) as a Test database? if yes, what's the best method for slow network?

    Scenario: I have a database in prod but don't have enough space on test server to restore the whole database. So I just like to restore a table and make it a database and run some tests.

  • You'll probably want to use a tool other than backup to copy the data from one server to another. The Import and Export Wizard or bcp are good bets.

    https://technet.microsoft.com/en-us/library/ms190923(v=sql.105).aspx

    https://technet.microsoft.com/en-us/library/ms141209(v=sql.105).aspx

  • if the two servers are on the same network, you could use a linked server and 4 part naming conventions to pull the data; easily the fastest way, assuming the linked servers exist.

    I'd script the table out without constraints and put it on Dev

    INSERT INTO TableName(ColumnList)

    SELECT ColumnList FROM MainServer.Productiondb.dbo.OriginalTable

    --WHERE CreatedDate > '12/01/2014' only partial data, maybe?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Personally, I would use BCP. It performs well for large amounts of data.

Viewing 4 posts - 1 through 3 (of 3 total)

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