Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Archive SQL table to file

Posted on 2010-09-23
3
Medium Priority
?
295 Views
Last Modified: 2012-05-10
Hi,
I need to archive a table from my sql database to file. Some records within the table contain XML data so i don't think exporting to csv/xls is an option. This data need to be archived programmatically on a regular basis. Also I need to know how to access this data in future if required(Import back in to temp table etc).
Thanks in advance for your help.
0
Comment
Question by:ncollings
3 Comments
 
LVL 9

Accepted Solution

by:
radcaesar earned 1500 total points
ID: 33742642
Use the bcp tool to export the data to flat files and use the pipe "|" delimiter.

If you want to schedule that for future use, Have the bcp command in a batch file (.bat) and schedule it.
0
 
LVL 15

Expert Comment

by:AmmarR
ID: 33743173
Dear ncollings

when you say archive file, do you mean you want to access this file or just store it.

because if you just need to archive to backup and storage, you can use sql db back up
by right clicking on a database --> task --> backup

but if you want to access it programmatically.
you can detach the database file as is dbname.mdf and connect to it using vb.net

hope it clarifies


0
 
LVL 3

Author Closing Comment

by:ncollings
ID: 33767756
Pointed me in the right direction
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question