How to transfer SQL Express data?

V

VB Programmer

I have a "version 1" of an ASP.NET 2.0 website. I am creating a "version 2"
of the website from scratch (re-architectured design). The V1 SQL Express
db has several tables which I want to transfer to my new site. Any
suggestions on an easy way to do this?

Thanks...
 
O

Otis Mukinfus

I have a "version 1" of an ASP.NET 2.0 website. I am creating a "version 2"
of the website from scratch (re-architectured design). The V1 SQL Express
db has several tables which I want to transfer to my new site. Any
suggestions on an easy way to do this?

Thanks...

I am guessing, but I think if you still have the MDF file you created when you
designed the database you will just need to deploy it to the new web site. In
fact, if I'm not mistaken, if you made changes to it in the new web site's DB
configuration they will also be moved to the new site. You may want to verify
what I said before doing anything that would lose data though.
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
C

Cowboy \(Gregory A. Beamer\)

SQL Express does not include SSIS (Integration Services), so you cannot use
it. But, you can still disconnect the file, connect at a new location and
add tables (option 1), script out definitions (third party tool, perhaps? --
option 2) or use a product like Visio to reverse engineer and forward
engineer to the new database (Visio probably not the #1 option here --
option 3).

Getting the data over is as easy as creating a DataSet, save to XML,
reconsitute, add data to the new database. There are also command line
options.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
 
W

William \(Bill\) Vaughn

Ah, you can still detach the existing database and reattach on the other
site or
setup a linked connection to the other instance and use a SELECT to move the
data or
use SqlClient.SqlBulkCopy to move the data.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
C

Cowboy \(Gregory A. Beamer\)

Re-reading, I can see the confusion. Thank you for pointing it out.

For those who read this, I am not suggesting you have to move the file and
the data. What Bill has stated is correct. If you detatch the file(s) and
move the data file (mdf) and log file (ldf) to another machine and attach,
you have the data. If you data schema has not changed at all, you can simply
move the file.

NOTE: I say files because you can, technically, commit all log entries and
simply move the mdf file (Not the wisest in many instances, but necessary at
times).

If, however, you have written a new schema with some of the same tables, you
can either

a) move the file(s) and then apply the new tables to the schema
b) migrate the data into the new schema

Migration options
------------------------
a) SSIS - not included with SQL Express
b) Bulk export and insert - not the best use of time with a single use
migration
c) DataSets - a bit kludgy, but creating a DataSet and migrating data in is
a good way to update to a table ... provided you do not have too much data
to migrate

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top