January 30, 2015 at 4:35 am
Dear expert
I am using import/export wizard to upload excel in sql table
I have primary key in my table
and all primary key value has been change every day
i.e. I have customer wise sales data and having 10 customer and sales value (two column in table), every day sales value increase/change, and new customer also adding every day
now every day I drop this table and update table as fresh file
but while uploading excel file can I use sql code which do as follow
1) if primary key exist in table update sales value (as per excel file) source file
2) if primary key does not exist then update in table as new row.
January 30, 2015 at 5:09 am
atul.jadhav (1/30/2015)
Dear expertI am using import/export wizard to upload excel in sql table
I have primary key in my table
and all primary key value has been change every day
i.e. I have customer wise sales data and having 10 customer and sales value (two column in table), every day sales value increase/change, and new customer also adding every day
now every day I drop this table and update table as fresh file
but while uploading excel file can I use sql code which do as follow
1) if primary key exist in table update sales value (as per excel file) source file
2) if primary key does not exist then update in table as new row.
now every day I drop this table
if primary key exist in table
Can you clarify and elaborate please? Currently this makes no sense.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
January 30, 2015 at 5:21 am
atul.jadhav (1/30/2015)
Dear expertI am using import/export wizard to upload excel in sql table
I have primary key in my table
and all primary key value has been change every day
i.e. I have customer wise sales data and having 10 customer and sales value (two column in table), every day sales value increase/change, and new customer also adding every day
now every day I drop this table and update table as fresh file
but while uploading excel file can I use sql code which do as follow
1) if primary key exist in table update sales value (as per excel file) source file
2) if primary key does not exist then update in table as new row.
Lots of words here, but no questions. What do you want help with?
January 30, 2015 at 8:50 pm
Dear both, in simple I want to append SQL table thru import/export wizard (from excel file) and that table having only tow column,
1) Customer Account No (Primary key/unique no.)
2) Sales Amount
now what I want,
1) if primary key exist in table update sales value (as per excel file) source file
2) if primary key does not exist then update in table as new row.
I hope I clear now,
Please go thru attachment file where I have mentioned with existing table, excel to be upload and expected result in SQL table
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply