Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Add-ons for VP-ASP
 How can I import product to database?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

coolw
Starting Member

8 Posts

Posted - March 07 2004 :  23:48:09  Show Profile  Reply with Quote
Hi there,

Does anyone know how to import excel file's data to database? I have to import a lot of product data to db. I used vpasp5.0 plus MSsql. Any feedback really appreciated! If someone can do this project for me please email at [email protected]. Thanks very much!

siraj
VP-CART New User

USA
194 Posts

Posted - March 08 2004 :  00:36:59  Show Profile  Visit siraj's Homepage  Reply with Quote
Use the DTS package to import the data into your product table.
The steps are:
1. Open the SQL EM and click on the database.
2. Right clcik on the database --> All task -->Import
3. In the dialog box selec the Excel 97 -2000 for data source
4. make sure your database is selected
5. Next and Follow the instructions.
6. You might have to transform the data to proper column.
If you need any help mail me.
GOOD LUCK.
SJ.


[email protected]
Go to Top of Page

coolw
Starting Member

8 Posts

Posted - March 08 2004 :  20:11:23  Show Profile  Reply with Quote
Thanks for your reply. but how can I import the cagegories ID at the same time? I noticed there is a "prodcategories" table in database. Thanks again

Go to Top of Page

siraj
VP-CART New User

USA
194 Posts

Posted - March 08 2004 :  22:23:34  Show Profile  Visit siraj's Homepage  Reply with Quote
If you have lot of products then the best bet is to write a small sql script to create view of prodcategories. You have to delete the table before you create the view, prodcategories, and write a view like

CREATE VIEW prodcategories AS
select catalogid AS id,
ccategory AS intcategoryid,
catalogid AS intcatalogid
from products

GOOD LUCK.
SJ.

[email protected]
Go to Top of Page

bmw000
VP-CART New User

137 Posts

Posted - March 15 2004 :  05:29:45  Show Profile  Visit bmw000's Homepage  Reply with Quote
Siraj,

If I already have my products in the database and I want to import to the field extendeddesc. Can I use this same DTS method?

I can't use vpasp's import utility for the extendeddesc because it contains multiple lines with carraige retuns, comma's and quotes in html format so I could never get that field to work. All other fields that were one line, like the name, desc, ccode, price, and weight all worked with vpasp's import utility.

I need a way to get my extendeddesc field imported.

I am using vpasp version 5 for microsoft sql server with the option package.

Any advice would be greatly appreciated.

Thanks In Advance,
Brian Weber
[email protected]

Go to Top of Page

siraj
VP-CART New User

USA
194 Posts

Posted - March 15 2004 :  08:33:46  Show Profile  Visit siraj's Homepage  Reply with Quote
Brian,
Yes, you can use the DTS to import only the particular field.
When you use DTS import, Follow this steps.
1. Import the products table
2 WHen you select the table name, in the same row, you will see something like Transform and click on that
3. Then you can ignore the field which you dont need and you can map to whatever the field you wnat to.
4. Then follow the Next --> Finish instructions.

If you need any help, mail me.
GOOD LUCK.
SJ.


[email protected]
Go to Top of Page

bmw000
VP-CART New User

137 Posts

Posted - March 15 2004 :  10:46:08  Show Profile  Visit bmw000's Homepage  Reply with Quote
Siraj,

Thanks for the info.

I will give it a try later tonight.

Just out of curiosity, Do you know how DTS matches the field with the right row? How does it match the ccode to get the extenddesc to go to the right part? Do I match ccode and extendeddesc? I don't want to create duplicate records at the end of my database or get the extendeddesc to the wrong item.

Go to Top of Page

siraj
VP-CART New User

USA
194 Posts

Posted - March 16 2004 :  09:21:20  Show Profile  Visit siraj's Homepage  Reply with Quote
If you have already the table imported and ccode fields is there, why dont you use the simple update statement.. You dont need the DTS.
Your update statement would be something like this,
UPDATE u
SET u.[fieldx]=c.[fieldx],
u.[fieldy] = c.[fieldy]
FROM [shopping500].[dbo].[products] u, [otherdb].[dbo].[tablename] c
WHERE u.[ccode]=c.[relatedccodefield]

If need any help, let me know.
GOOD LUCK.
SJ.

[email protected]
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00