Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Mainframe and SQL Server Expand / Collapse
Author
Message
Posted Wednesday, April 29, 2009 9:49 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, April 30, 2009 4:59 PM
Points: 14, Visits: 66
Hi,

I'm trying to replace current mainframe system which uses mainframe application with backend mainframe database with SQL database in backend and Windows application written on C#. Currently looking at mainframe database, they have different fields using the same information. For example, They have Home address of 20 chars length and then another field street number which is 4 character length and consists of same information as first 4 characters of Home address field. To me, it seems like some kind of programming constraints of mainframes. In sql we can use string functions like substring etc. to get out first 4 chars from Home address. From the way I think, 2 different columns are not necessary. What would be the pros and cons of having 2 different columns or not having 2 different columns? Which one sounds more logical? I would appreciate your help.

Thanks,
Tur
Post #707374
Posted Thursday, April 30, 2009 5:07 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, July 15, 2011 3:28 AM
Points: 87, Visits: 121
Hi,

If the smaller field is indexed it would be a lot smaller than on the full address.

If there's a postcode field then all that may be required to establish a full exact address is to combine the value from the small field with the result from a postcode lookup service / db. Whilst the larger address field is there for when a postcode lookup may not work (ie. for some business addresses).

Cheers, Jode
Post #707563
Posted Thursday, April 30, 2009 7:22 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:21 PM
Points: 11,885, Visits: 22,843
From a strict, structural stand point, no it doesn't make any sense to break that data out in that fashion. Not unless you're breaking down all the address information so that the street is in a seperate field too.

But, there could be a business or functional reason to seperate out that data. None come to mind at the moment, but that doesn't mean there isn't one.

However, in general, no I wouldn't do that with data that I can easily pull when needed with little overhead or performance hit.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #707666
Posted Thursday, April 30, 2009 7:41 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 4:40 AM
Points: 6,627, Visits: 7,336
also keep in mind when migrating an existing data system, you will have to deal with legacy short comings, data or data structures that doesn't make sense, but is those errors may even not come to surface in the current applications because of the way things are written, data and data usage dependencies,...

With sqlserver you have "calculated columns" which may give you the same result as what you are seeing in your current systems layout.


Johan

Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution"


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me but most of the time this is me
Post #707683
Posted Thursday, April 30, 2009 4:55 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, April 30, 2009 4:59 PM
Points: 14, Visits: 66
Hi Jody Andrews, Grant Fritchey, ALZDBA,

Thanks for your valuable input. Jody, I agree with you that smaller columns takes less space when we create index to increase query performance if this smaller column has some valuable data or uniqueness. Home Address was just an example cooked up by me. But still I think, this extra column will add space overhead to our sql database. Grant, I agree with you that if some information can be gathered easily from already existing column, its stupidity and against normalization rules of sql to add new column with substring of another field. Thanks ALZDBA for taking me one step further towards the migration process. I haven't reached that point yet. We will have some mainframe programmers write the program to extract data to the flat file and SQL developers will use that flat file to import to the SQL database yet to be designed.
I wanted to know the pros and cons like space usage, performance etc. between our option to keep the same field or different field.

Please feel free to add anything you think might be helpful for me or anything you have gone through before.

Thanks,
Post #708181
Posted Tuesday, May 05, 2009 3:01 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 9:12 AM
Points: 2,425, Visits: 2,322
To me, it seems like some kind of programming constraints of mainframes


The strange thing you see is due to the application design, not to the platform it is running on. Speaking as a former mainframe person you may not believe this, but I have also seen some wierd designs on Windows systems...


Author: SQL Server FineBuild 1-click install and best practice configuration of SQL Server 2005, 2008, 2008 R2 and 2012. 16 December 2011: now over 17,000 downloads.
Disclaimer: All information provided is a personal opinion that may not match reality.
Concept: "Pizza Apartheid" - the discrimination that separates those who earn enough in one day to buy a pizza if they want one, from those who can not.
Post #709989
Posted Tuesday, May 12, 2009 1:25 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 2:50 PM
Points: 516, Visits: 1,558
The main reason for breaking something like address into seperate fields would be validation, things like street names, street types, etc. can be in lookup tables. I see no reason to have the fields seperated but then have a field that is a combination of more than one field. You could check to see if there is a problem with the extracting of the data that picks up the same data more than once.

Steve



Post #715418
Posted Tuesday, May 12, 2009 4:23 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Thursday, November 17, 2011 4:09 PM
Points: 9,359, Visits: 8,864
Actually, I have seen perfectly valid reasons for having both the extracted subfields and the whole address as originally input.

The crux of it is that addresses are notoriously dirty, mangy and amorphous pieces of text, that can virtually never be parsed by a computer with 100% accuracy. Consequently, some apps and business that I know of attempt to parse out the address into more codified subfields (like street number, etc.), but these are never truly complete. Therefore, it is important to keep the original address text, potentially for prodcing the label, but also for human inspection to determine of the subfiled extraction was correct and because if improved algorithims are brought in later, you may want it to repars some of the older, mangier addressses.

And finally, there may be legal issues and reasons why the exact original text must be preserved.


-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #715530
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse