Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Importing Data into SQL2000 from XL

Author  Topic 

ronji
Starting Member

8 Posts

Posted - 2004-08-16 : 01:55:34
Hi there,

Forgive me for being a dunce :)

I have exported data from my database to an excel spreadsheet. I have then added data to the file.
I now want to import the file back into SQL. I have spent 24 hours trying to work it out and have been into BOL.

PLease help

Kind regards Ron

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-08-16 : 02:36:11
you're forgiven....

A few options:
Set up a linked server to point at the s/s. Then run normal selects/inserts to get the data back in.
Write a DTS package that uses the Excel OLE objects to get the data into the DB
Write some VBA macros in the s/s to upload the data into the db

Many different ways you can skin this one, depending on your preference.
Go to Top of Page

ronji
Starting Member

8 Posts

Posted - 2004-08-16 : 02:54:14
Thanks timmy for not making me feel to bad

Which is the best way to link the db to an excel spreadsheet and could you please provide me with an idea of the code to insert the data into the DB.

Or point me in the right direction to learn this stuff.

My skillset is in graphic and Website design but not SQL. (very unhappy)

regards Ron

Go to Top of Page

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-08-16 : 07:41:20
That's ok - we need colouring in people ;-)

Is your spreadsheet in a consistent format (i.e is it formatted into nice columns)? If so, then Linked servers is probably the best bet. Have a look in BOL for info on this.
Go to Top of Page

ronji
Starting Member

8 Posts

Posted - 2004-08-16 : 18:53:51
HI There,

I have linked the table in the DB. Coul dyou please give me an example of the code I would use in Query analyser to copy the data between db's

THe linked DB is called products_ncawebstore and the table is products
the destination DB is ncawebstore and the table is products.
regards Ron
Go to Top of Page
   

- Advertisement -