Restoring just few columns of a table.

How do we restore just few columns of a table from one database to another.. say for example, if we need only 3 attribute's data of the a table consisting of 30 attributes in total. It is a sql server 200O database. Anything that we need to keep in mind in order to process this ? my initial idea was, to use export and import utility, to get the specific columns from table in the DB...This question is to confirm my thoughts and learn if any new ideas or efficient ways to do this.


more ▼

asked Feb 15, 2010 at 03:05 PM in Default

Katie 1 gravatar image

Katie 1
1.4k 132 163 202

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

If this is a one-time operation, your idea should work fine. If you need to maintain the copy, you can use replication with only the desired columns selected as articles. Please note I have only used replication with SQL Server 2005, but I believe what I described should also work with 2000.

more ▼

answered Feb 15, 2010 at 03:16 PM

Tom Staab gravatar image

Tom Staab
5.8k 6 8 10

(comments are locked)
10|1200 characters needed characters left

If you want a neat GUI to handle the process then RedGate's SQL Data Compare is a great tool. I use it when we have to do a RESTORE and then identify what has changed since the last backup but it could do what you need too. There is a 14 day free trial if you want to take a look at it http://www.red-gate.com/products/SQL_Data_Compare/index.htm, as they say, it compares and synchronises database contents. Check out their SQL Compare too as that could help you synch the schemas/tables etc in the two databases.

more ▼

answered Feb 15, 2010 at 04:01 PM

Fatherjack gravatar image

Fatherjack ♦♦
42.8k 75 79 108

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Feb 15, 2010 at 03:05 PM

Seen: 1665 times

Last Updated: Feb 15, 2010 at 03:16 PM