January 10, 2016 at 2:02 pm
Rankerg (1/10/2016)
That is the requirement, any changes to any column means that is a CHANGED / MODIFIED record and these CHANGED/ MODIFIED files I want ? duplicates to be ignored
[Deep breath]
As I've said before, we are not in the game of guessing, neither the questions nor the answers!
😎
If you need to create a merge or a delta of existing and incoming datasets then thats easy, if you want to time travel then that's slightly harder but doable, if you want an answer to a question that hasn't been asked then that's impossible.
January 10, 2016 at 2:05 pm
Yes I think this is pretty close, I want the amended and new records in a NEW File
January 10, 2016 at 2:28 pm
Rankerg (1/10/2016)
Yes I think this is pretty close, I want the amended and new records in a NEW File
am a bit confused...what are you going to do with your NEW FILE ?
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
January 10, 2016 at 2:28 pm
Rankerg (1/10/2016)
Yes I think this is pretty close, I want the amended and new records in a NEW File
Now it's time for you to post the full requirements and all the information needed to answer your question
😎
January 10, 2016 at 4:58 pm
so the application which I am going to feed this NEW Files expects DELTA (amended and new) records only, if it is existing / duplicate records then it will move the current file from PRODUCT Table to PRODHISTORY table and since we get around 300k records every month there will be redundant data in the HISTORY table.
January 10, 2016 at 5:01 pm
I get a flat / EDI file from client and ETL to the DB and since the client is sending entire yearly data instead of DELTA I need to filter the DELTA records. I am not sure WHAT ELSE I can provide, I already mentioned the file has 140 columns / fields
January 10, 2016 at 10:46 pm
Rankerg (1/10/2016)
I am not sure WHAT ELSE I can provide, I already mentioned the file has 140 columns / fields
Hugo already explained.
So if any tables are involved (I assume there are, otherwise you wouldn't post on this site), then post their schema, in the form of a CREATE TABLE statement that includes all the constraints.
For any tables that contain data (imported data or existing data), provide us with sample data in the form of INSERT statements. Please test the CREATE TABLE and INSERT statements. The easier it is for us to recreate your problem, the more chance we are willing to help you - and copy, paste, execute is the easiest it gets.
If external data sources are involved, tell us exactly what they look like. If for instance you import Excel sheets, then either attach a sample sheet, or post a screenshot of a sheet. Of course if you already imported the Excel data into a staging table, then simply give us that table (CREATE TABLE and INSERT statements) instead.
For all the sample data posted, keep in mind that it has to be representative (i.e. all normal and special cases should be included), and as short as possible (so don't post your two-million row production database, but create a sample that illustrates the issue in ideally less than a dozen rows).
Finally, post the expected results. For this a tabular format is often ideal (as a screenshot or use a fixed-width datatype, and check in preview mode that spaces are retained - use the code tag if needed). Also, remember that what's be obvious to you may not be obvious to others, so do add some explanation to help us understand how the sample input data results in the posted end result.
So that's 4 things:
CREATE TABLE statements for all tables involved
Sample data for those tables
A sample of the file you're importing
What you want as results at the end
Sure, the file has 140 columns, but we have no idea what they are, what data types they are, what the imported data looks like (the previous month's data that needs to be compared with), and, more importantly, we can't test any code we write.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 11, 2016 at 12:11 pm
Rankerg (1/10/2016)
Yes I think this is pretty close, I want the amended and new records in a NEW File
give us a clue......how close? whats incorrect?
sample scripts as already asked for will help us help you
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
January 11, 2016 at 2:34 pm
Rankerg (1/10/2016)
I get a flat / EDI file from client and ETL to the DB and since the client is sending entire yearly data instead of DELTA I need to filter the DELTA records. I am not sure WHAT ELSE I can provide, I already mentioned the file has 140 columns / fields
If most of those 140 columns are supposed to be treated the same, then by all means trim it down to a dozen or so before posting. I am sure you can copy/paste/change the pattern once there is a good solution.
But we really, really, really need to have actual tables, and actual data, in our hands in order to help you. Otherwise it'll just continue to be a guessing time, wasting both your and our time.
January 11, 2016 at 2:39 pm
So creating a store procedure and like to pass table name as parameter?
January 11, 2016 at 3:14 pm
Rankerg (1/11/2016)
So creating a store procedure and like to pass table name as parameter?
No.
Viewing 11 posts - 16 through 25 (of 25 total)
You must be logged in to reply to this topic. Login to reply