dbTalk Databases Forums  

Newbie: Update From Excel

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Newbie: Update From Excel in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Cavan Vannice
 
Posts: n/a

Default Newbie: Update From Excel - 06-06-2005 , 09:44 AM






I am a newbie at SQL Server, but I do have a little experience from
Coldfusion. Here's my Question.

We have a database for our business. We sell products. and we get price
lists in excel format all the time. I am working with DTS and I would like to
set it up, so that I can format the spreadsheet, properly and execute the
package. easy as 1,2,3 right?

Well I have tried many things from doing it in SQL DTS to Access, and
everything is a no go. I have limited SQL knowledge but here is of the things
I have tried and it seems to me it should work.

INSERT
INTO Product (ListPrice)
SELECT ListPrice
FROM
[Product$]
WHERE (ProductID = Product $ .ProductID)



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Newbie: Update From Excel - 06-06-2005 , 01:04 PM






The statement that you there will not work.

Is the data still in Excel or have you imported it?

You would need to use an ExecuteSQL task to do it the way you detail and
you will need to use either a Linked Server or OPENDATASOURCE to query
the Excel spreadsheet. Examples of both are in BOL.

You can alternatively use a DataPump to transfer the data easily enough
if the format is OK.

Allan

"Cavan Vannice" <Cavan Vannice (AT) discussions (DOT) microsoft.com> wrote in
message news:Cavan Vannice (AT) discussions (DOT) microsoft.com:

Quote:
I am a newbie at SQL Server, but I do have a little experience from
Coldfusion. Here's my Question.

We have a database for our business. We sell products. and we get price
lists in excel format all the time. I am working with DTS and I would like to
set it up, so that I can format the spreadsheet, properly and execute the
package. easy as 1,2,3 right?

Well I have tried many things from doing it in SQL DTS to Access, and
everything is a no go. I have limited SQL knowledge but here is of the things
I have tried and it seems to me it should work.

INSERT
INTO Product (ListPrice)
SELECT ListPrice
FROM
[Product$]
WHERE (ProductID = Product $ .ProductID)


Reply With Quote
  #3  
Old   
Cavan Vannice
 
Posts: n/a

Default Re: Newbie: Update From Excel - 06-06-2005 , 01:14 PM



The data is still in excel, what is BOL?

"Allan Mitchell" wrote:

Quote:
The statement that you there will not work.

Is the data still in Excel or have you imported it?

You would need to use an ExecuteSQL task to do it the way you detail and
you will need to use either a Linked Server or OPENDATASOURCE to query
the Excel spreadsheet. Examples of both are in BOL.

You can alternatively use a DataPump to transfer the data easily enough
if the format is OK.

Allan

"Cavan Vannice" <Cavan Vannice (AT) discussions (DOT) microsoft.com> wrote in
message news:Cavan Vannice (AT) discussions (DOT) microsoft.com:

I am a newbie at SQL Server, but I do have a little experience from
Coldfusion. Here's my Question.

We have a database for our business. We sell products. and we get price
lists in excel format all the time. I am working with DTS and I would like to
set it up, so that I can format the spreadsheet, properly and execute the
package. easy as 1,2,3 right?

Well I have tried many things from doing it in SQL DTS to Access, and
everything is a no go. I have limited SQL knowledge but here is of the things
I have tried and it seems to me it should work.

INSERT
INTO Product (ListPrice)
SELECT ListPrice
FROM
[Product$]
WHERE (ProductID = Product $ .ProductID)



Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Newbie: Update From Excel - 06-06-2005 , 01:42 PM



BOL is one of the single most useful resources for your SQL Server
installation. Books Online aka the help files.



"Cavan Vannice" <CavanVannice (AT) discussions (DOT) microsoft.com> wrote in
message news:CavanVannice (AT) discussions (DOT) microsoft.com:

Quote:
The data is still in excel, what is BOL?

"Allan Mitchell" wrote:

The statement that you there will not work.

Is the data still in Excel or have you imported it?

You would need to use an ExecuteSQL task to do it the way you detail and
you will need to use either a Linked Server or OPENDATASOURCE to query
the Excel spreadsheet. Examples of both are in BOL.

You can alternatively use a DataPump to transfer the data easily enough
if the format is OK.

Allan

"Cavan Vannice" <Cavan Vannice (AT) discussions (DOT) microsoft.com> wrote in
message news:Cavan Vannice (AT) discussions (DOT) microsoft.com:

I am a newbie at SQL Server, but I do have a little experience from
Coldfusion. Here's my Question.

We have a database for our business. We sell products. and we get price
lists in excel format all the time. I am working with DTS and I would like to
set it up, so that I can format the spreadsheet, properly and execute the
package. easy as 1,2,3 right?

Well I have tried many things from doing it in SQL DTS to Access, and
everything is a no go. I have limited SQL knowledge but here is of the things
I have tried and it seems to me it should work.

INSERT
INTO Product (ListPrice)
SELECT ListPrice
FROM
[Product$]
WHERE (ProductID = Product $ .ProductID)




Reply With Quote
  #5  
Old   
Cavan Vannice
 
Posts: n/a

Default Re: Newbie: Update From Excel - 06-06-2005 , 02:22 PM



I realised that after i posted, thanks

Here's where I am:

Latest query in DTS

INSERT INTO Product
(ListPrice)
SELECT [Product$].ListPrice
FROM Product INNER JOIN
[Product$] ON Product.ProductID = [Product$].ProductID


Syntax checks out and the it runs fine, but it does not do anything to the
database. To explain my self better heres the basics of what I am doing:

Product$(excel) Product

ProductID ------> ProductID
ListPrice ------> ListPrice
more
more
more
more
more
more

If the productID's match, then the price from the spreadsheet overwrites the
price in the database, and in the end the Manufactururs code will have to
match, right now I am simply working out the proccess.

For better understanding I am testing on AdventureWorks2000, I exported the
products table, modified the the top 5 lines, and am now trying to update the
prices by ProductID.

Thanks in advance for any help provided and already so.

Cavan



"Allan Mitchell" wrote:

Quote:
BOL is one of the single most useful resources for your SQL Server
installation. Books Online aka the help files.



"Cavan Vannice" <CavanVannice (AT) discussions (DOT) microsoft.com> wrote in
message news:CavanVannice (AT) discussions (DOT) microsoft.com:

The data is still in excel, what is BOL?

"Allan Mitchell" wrote:

The statement that you there will not work.

Is the data still in Excel or have you imported it?

You would need to use an ExecuteSQL task to do it the way you detail and
you will need to use either a Linked Server or OPENDATASOURCE to query
the Excel spreadsheet. Examples of both are in BOL.

You can alternatively use a DataPump to transfer the data easily enough
if the format is OK.

Allan

"Cavan Vannice" <Cavan Vannice (AT) discussions (DOT) microsoft.com> wrote in
message news:Cavan Vannice (AT) discussions (DOT) microsoft.com:

I am a newbie at SQL Server, but I do have a little experience from
Coldfusion. Here's my Question.

We have a database for our business. We sell products. and we get price
lists in excel format all the time. I am working with DTS and I would like to
set it up, so that I can format the spreadsheet, properly and execute the
package. easy as 1,2,3 right?

Well I have tried many things from doing it in SQL DTS to Access, and
everything is a no go. I have limited SQL knowledge but here is of the things
I have tried and it seems to me it should work.

INSERT
INTO Product (ListPrice)
SELECT ListPrice
FROM
[Product$]
WHERE (ProductID = Product $ .ProductID)





Reply With Quote
  #6  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Newbie: Update From Excel - 06-06-2005 , 02:36 PM



In what task do you have this statement?

Product$ is in Excel still? If yes then how? Looks like a SQL Server
table after an import from Excel to me.

Allan


"Cavan Vannice" <CavanVannice (AT) discussions (DOT) microsoft.com> wrote in
message news:CavanVannice (AT) discussions (DOT) microsoft.com:

Quote:
I realised that after i posted, thanks

Here's where I am:

Latest query in DTS

INSERT INTO Product
(ListPrice)
SELECT [Product$].ListPrice
FROM Product INNER JOIN
[Product$] ON Product.ProductID = [Product$].ProductID


Syntax checks out and the it runs fine, but it does not do anything to the
database. To explain my self better heres the basics of what I am doing:

Product$(excel) Product

ProductID ------> ProductID
ListPrice ------> ListPrice
more
more
more
more
more
more

If the productID's match, then the price from the spreadsheet overwrites the
price in the database, and in the end the Manufactururs code will have to
match, right now I am simply working out the proccess.

For better understanding I am testing on AdventureWorks2000, I exported the
products table, modified the the top 5 lines, and am now trying to update the
prices by ProductID.

Thanks in advance for any help provided and already so.

Cavan



"Allan Mitchell" wrote:

BOL is one of the single most useful resources for your SQL Server
installation. Books Online aka the help files.



"Cavan Vannice" <CavanVannice (AT) discussions (DOT) microsoft.com> wrote in
message news:CavanVannice (AT) discussions (DOT) microsoft.com:

The data is still in excel, what is BOL?

"Allan Mitchell" wrote:

The statement that you there will not work.

Is the data still in Excel or have you imported it?

You would need to use an ExecuteSQL task to do it the way you detail and
you will need to use either a Linked Server or OPENDATASOURCE to query
the Excel spreadsheet. Examples of both are in BOL.

You can alternatively use a DataPump to transfer the data easily enough
if the format is OK.

Allan

"Cavan Vannice" <Cavan Vannice (AT) discussions (DOT) microsoft.com> wrote in
message news:Cavan Vannice (AT) discussions (DOT) microsoft.com:

I am a newbie at SQL Server, but I do have a little experience from
Coldfusion. Here's my Question.

We have a database for our business. We sell products. and we get price
lists in excel format all the time. I am working with DTS and I would like to
set it up, so that I can format the spreadsheet, properly and execute the
package. easy as 1,2,3 right?

Well I have tried many things from doing it in SQL DTS to Access, and
everything is a no go. I have limited SQL knowledge but here is of the things
I have tried and it seems to me it should work.

INSERT
INTO Product (ListPrice)
SELECT ListPrice
FROM
[Product$]
WHERE (ProductID = Product $ .ProductID)






Reply With Quote
  #7  
Old   
Cavan Vannice
 
Posts: n/a

Default Re: Newbie: Update From Excel - 06-06-2005 , 04:17 PM



IT is a DTS Package Excel spreadsheet is a connection, then to the database,
then the execute SQL task. I am really not partial to any particular way of
doing it, just something that can be changed and implemented easy. This will
be a regular if not daily process.

Thanks

P.S. I wouldnt mind seeing some similar examples, if anyone knows any posts


"Allan Mitchell" wrote:

Quote:
In what task do you have this statement?

Product$ is in Excel still? If yes then how? Looks like a SQL Server
table after an import from Excel to me.

Allan


"Cavan Vannice" <CavanVannice (AT) discussions (DOT) microsoft.com> wrote in
message news:CavanVannice (AT) discussions (DOT) microsoft.com:

I realised that after i posted, thanks

Here's where I am:

Latest query in DTS

INSERT INTO Product
(ListPrice)
SELECT [Product$].ListPrice
FROM Product INNER JOIN
[Product$] ON Product.ProductID = [Product$].ProductID


Syntax checks out and the it runs fine, but it does not do anything to the
database. To explain my self better heres the basics of what I am doing:

Product$(excel) Product

ProductID ------> ProductID
ListPrice ------> ListPrice
more
more
more
more
more
more

If the productID's match, then the price from the spreadsheet overwrites the
price in the database, and in the end the Manufactururs code will have to
match, right now I am simply working out the proccess.

For better understanding I am testing on AdventureWorks2000, I exported the
products table, modified the the top 5 lines, and am now trying to update the
prices by ProductID.

Thanks in advance for any help provided and already so.

Cavan



"Allan Mitchell" wrote:

BOL is one of the single most useful resources for your SQL Server
installation. Books Online aka the help files.



"Cavan Vannice" <CavanVannice (AT) discussions (DOT) microsoft.com> wrote in
message news:CavanVannice (AT) discussions (DOT) microsoft.com:

The data is still in excel, what is BOL?

"Allan Mitchell" wrote:

The statement that you there will not work.

Is the data still in Excel or have you imported it?

You would need to use an ExecuteSQL task to do it the way you detail and
you will need to use either a Linked Server or OPENDATASOURCE to query
the Excel spreadsheet. Examples of both are in BOL.

You can alternatively use a DataPump to transfer the data easily enough
if the format is OK.

Allan

"Cavan Vannice" <Cavan Vannice (AT) discussions (DOT) microsoft.com> wrote in
message news:Cavan Vannice (AT) discussions (DOT) microsoft.com:

I am a newbie at SQL Server, but I do have a little experience from
Coldfusion. Here's my Question.

We have a database for our business. We sell products. and we get price
lists in excel format all the time. I am working with DTS and I would like to
set it up, so that I can format the spreadsheet, properly and execute the
package. easy as 1,2,3 right?

Well I have tried many things from doing it in SQL DTS to Access, and
everything is a no go. I have limited SQL knowledge but here is of the things
I have tried and it seems to me it should work.

INSERT
INTO Product (ListPrice)
SELECT ListPrice
FROM
[Product$]
WHERE (ProductID = Product $ .ProductID)







Reply With Quote
  #8  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Newbie: Update From Excel - 06-06-2005 , 05:19 PM





Ok So here is what you do

Add an Excel Connection.
Point it to your spreadsheet

Add a SQL Server connection
Point it to your SQL Server

Now create a transform data task coming from the Excel Spreadsheet to the
SQL Server

Double click on the Black line (The transform data task).

In the Source drop down the Table/View combobox and choose the Excel table
you require

Now go to the destinations tab and select your destination table

On the transformations tab map the source columns to thier respective
Destination.



--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Cavan Vannice" <CavanVannice (AT) discussions (DOT) microsoft.com> wrote

Quote:
IT is a DTS Package Excel spreadsheet is a connection, then to the
database,
then the execute SQL task. I am really not partial to any particular way
of
doing it, just something that can be changed and implemented easy. This
will
be a regular if not daily process.

Thanks

P.S. I wouldnt mind seeing some similar examples, if anyone knows any
posts


"Allan Mitchell" wrote:

In what task do you have this statement?

Product$ is in Excel still? If yes then how? Looks like a SQL Server
table after an import from Excel to me.

Allan


"Cavan Vannice" <CavanVannice (AT) discussions (DOT) microsoft.com> wrote in
message news:CavanVannice (AT) discussions (DOT) microsoft.com:

I realised that after i posted, thanks

Here's where I am:

Latest query in DTS

INSERT INTO Product
(ListPrice)
SELECT [Product$].ListPrice
FROM Product INNER JOIN
[Product$] ON Product.ProductID =
[Product$].ProductID


Syntax checks out and the it runs fine, but it does not do anything to
the
database. To explain my self better heres the basics of what I am
doing:

Product$(excel) Product

ProductID ------> ProductID
ListPrice ------> ListPrice
more
more
more
more
more
more

If the productID's match, then the price from the spreadsheet
overwrites the
price in the database, and in the end the Manufactururs code will have
to
match, right now I am simply working out the proccess.

For better understanding I am testing on AdventureWorks2000, I exported
the
products table, modified the the top 5 lines, and am now trying to
update the
prices by ProductID.

Thanks in advance for any help provided and already so.

Cavan



"Allan Mitchell" wrote:

BOL is one of the single most useful resources for your SQL Server
installation. Books Online aka the help files.



"Cavan Vannice" <CavanVannice (AT) discussions (DOT) microsoft.com> wrote in
message news:CavanVannice (AT) discussions (DOT) microsoft.com:

The data is still in excel, what is BOL?

"Allan Mitchell" wrote:

The statement that you there will not work.

Is the data still in Excel or have you imported it?

You would need to use an ExecuteSQL task to do it the way you
detail and
you will need to use either a Linked Server or OPENDATASOURCE to
query
the Excel spreadsheet. Examples of both are in BOL.

You can alternatively use a DataPump to transfer the data easily
enough
if the format is OK.

Allan

"Cavan Vannice" <Cavan Vannice (AT) discussions (DOT) microsoft.com> wrote
in
message news:Cavan Vannice (AT) discussions (DOT) microsoft.com:

I am a newbie at SQL Server, but I do have a little experience
from
Coldfusion. Here's my Question.

We have a database for our business. We sell products. and we
get price
lists in excel format all the time. I am working with DTS and I
would like to
set it up, so that I can format the spreadsheet, properly and
execute the
package. easy as 1,2,3 right?

Well I have tried many things from doing it in SQL DTS to
Access, and
everything is a no go. I have limited SQL knowledge but here is
of the things
I have tried and it seems to me it should work.

INSERT
INTO Product (ListPrice)
SELECT ListPrice
FROM
[Product$]
WHERE (ProductID = Product $ .ProductID)









Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.