473,440 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,440 software developers and data experts.

How Can I export/inport my database into and from a CSV/SQL file?

Kabyr
29
I have created a database for an application.

Some of the tables in the database contain initial data required to run the application and some of the data are more than 1000 records.

I need to export this data into an sql,txt or scv file so that during installation, i can just run a database creation script to inport it into a new database just like you create oracle dump.

I do not want to run the data migration wizard every time i have to install the application.

Thank you in advance.
Aug 4 '10 #1

✓ answered by NeoPa

BACKUP and RESTORE commands are available in T-SQL. They are quite flexible and allow you a great deal of control. There is far too much in there to cover here, so I suggest you look in Books Online for each command as you are setting them up.

Your original backup (done whenever you have a new version to release) can be done either with code or through the Management Studio interface.

The installation routine would need to include the RESTORE code to apply the full copy of the database onto the new server.

Welcome to Bytes!

5 2209
gpl
152 100+
If it is a Microsoft SQL Server database, you can use Enterprise Manager - Data Transformation Service to export the data into csv files
Aug 4 '10 #2
ck9663
2,878 Expert 2GB
Or you can create a template database, back that up and just restore it during installation.

Good Luck!!!

~~ CK
Aug 5 '10 #3
Kabyr
29
Thank you for your replies. One of the things I am avoiding is using the Enterprise Manager to export the database and in case I suceed with that. How do I import it using code?

Second is if I have to backup the database from MS SQL Server, Can I achieve that with code? if yes how do I restore on client machine using code.

The high point of all these is that I am working with VB6 and just want to have this put together, and called from VB. Once done, I want to package everything on an installation disk. I dont have to be there when they need to do a new installation.

Thank you for the help.
Aug 10 '10 #4
NeoPa
32,556 Expert Mod 16PB
BACKUP and RESTORE commands are available in T-SQL. They are quite flexible and allow you a great deal of control. There is far too much in there to cover here, so I suggest you look in Books Online for each command as you are setting them up.

Your original backup (done whenever you have a new version to release) can be done either with code or through the Management Studio interface.

The installation routine would need to include the RESTORE code to apply the full copy of the database onto the new server.

Welcome to Bytes!
Aug 10 '10 #5
Kabyr
29
Thank you for the help.
Aug 19 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Thomas Massong | last post by:
Hello, i have a problem with an ixf file and need your help. Is there any way to export such a file to ascii or some other readable format for a Windows PC? Unfortunaly we have no other way...
6
by: Oliver Stratmann | last post by:
Hello all, is there another way to export data to a csv-file (comma-separated format)? We tried the EXPORT-command and got the following error " SQL1325N The remote database environment does...
4
by: barbara_dave | last post by:
Hi, all We have a database which was running on the server and used by several users. We can not the database now with the following message: The "*.mdb" need to be repaired or isn't a...
1
by: ad | last post by:
I want user can upload an excel file and export into database. How can I do that?
5
by: Claudio Grondi | last post by:
I have just started to play around with the bsddb3 module interfacing the Berkeley Database. Beside the intended database file databaseFile.bdb I see in same directory also the __db.001...
6
by: xpcer | last post by:
Please help me to convert database. This is the problem, i work at an IT company. i'm junior database engineer at there. my task is converting database file from another format to mysql format....
2
by: Guvnor | last post by:
Hello there, I have about 30 sql servers runnign multiple databases amd i need to audit them so what i want to do is to log onto each server and then maybe export the database properties into an...
7
by: Kosmos | last post by:
Hey guys, I was hoping someone could give me an idea of where I should look for this..my access database file is rapidly growing....but I have the access database import an excel spreadsheet and...
0
by: vincent90152900 | last post by:
I need to export a database, x, of a server, X, to another database, y, of a server, Y and I need export the database schema only, not include the data. Does anyone know how to do that? Many thanks...
1
by: Wayne L | last post by:
I am trying to export a text file and before exporting I want to type the information to be inserted or select from a list. Is this possible?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.