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.
Author |
Topic |
Noe
Starting Member
3 Posts |
Posted - 2012-10-23 : 11:53:23
|
Hi,I need to create a new table.The "New Table" is the combination of the "employee" and "Personnel" tables where the Personnel Table.When combining the tables, I need to keep the information from the "Personnel" Table and add the missing fields or records not found on the "Personnel" table.A big issue is that the "Employee" Table has the name of the employee in one field while the "Personnel" table has it broken down into 3 fields.Could you please help me?Thank you, NoePlease see below the two tables, their fields and the Table I need to get from their combination:Employee.................Personnel...............New TableEmployeeNumber......EmployeeNumber.....EmployeeNumberEmployeeName.........LastName...............LastNameTitle........................FirstName..............FirstNameBuildingCode............MiddleInitial...........MiddleInitialDistrict....................Job Title................Job Title..............................Location Code.........Location Code..............................District..................District |
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2012-10-23 : 12:07:04
|
I don't see any difference between the Personnel table and the new table.JimEveryday I learn something that somebody else already knew |
|
|
Noe
Starting Member
3 Posts |
Posted - 2012-10-23 : 13:15:06
|
Jim, The fields look similar but the tables do not contain the same records. I left out the fields I do not need.The name of the employee in one table is contained in one field while on the other table the name of theemployee is broken down into 3 fields(name, middle initial, and last name).I am trying add the records not found in the "Personnel" table together with those ones in the personnel table into a new table.One issue is how to break the employee name into three fields.Originally posted by jimf I don't see any difference between the Personnel table and the new table.Jim |
|
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2012-10-23 : 14:11:36
|
Breaking names apart is a notoriously difficult thing to do. As examples:"David Henry Thoreau" simple enough; First Middle and Last"Ludwig von Beethoven" not so simple; First and Last"John Smith Senior" Actually a last name or a designator?=================================================We are far more concerned about the desecration of the flag than we are about the desecration of our land. -Wendell Berry |
|
|
Noe
Starting Member
3 Posts |
Posted - 2012-10-23 : 15:37:18
|
Bustaz, I do not mean any disrespect: I need help or guidance and you are not doing either one with your comment.quote: Originally posted by Bustaz Kool Breaking names apart is a notoriously difficult thing to do. As examples:"David Henry Thoreau" simple enough; First Middle and Last"Ludwig von Beethoven" not so simple; First and Last"John Smith Senior" Actually a last name or a designator?=================================================We are far more concerned about the desecration of the flag than we are about the desecration of our land. -Wendell Berry
|
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-10-23 : 18:27:04
|
quote: Originally posted by Noe Bustaz, I do not mean any disrespect: I need help or guidance and you are not doing either one with your comment.quote: Originally posted by Bustaz Kool Breaking names apart is a notoriously difficult thing to do. As examples:"David Henry Thoreau" simple enough; First Middle and Last"Ludwig von Beethoven" not so simple; First and Last"John Smith Senior" Actually a last name or a designator?=================================================We are far more concerned about the desecration of the flag than we are about the desecration of our land. -Wendell Berry
Nope he was telling various business cases you need to consider. There's no straight forward way to break the names unless you can guarantee the format (which 90 % of cases you cant)Otherways you've group them based on their format and apply a different logic for each group------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|