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.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Database with no FK

Author  Topic 

Drewyd
Starting Member

2 Posts

Posted - 2014-09-17 : 16:00:12
Hi all,

I am new to the DBA role, though had many years attempting to write T-SQL queries and procedures.

I have got a new job administering a server with a dozen or so databases set up by a "professional" company who have charged my new employer an arm & leg for the privilege. On first inspection of the 2000+ tables in the main database, I am shocked to discover there is not a single FK anywhere. Only about 85% of the tables have a PK. There seems to be a lot of duplicated data and no validation to speak of (no check constraints at all either), for example with items like post codes appearing in any one of five fields in the client address tables.

Any advice, where do I start with this nightmare?

Drew

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-09-17 : 16:07:06
Does your company own the software? If it's a 3rd party app, you typically are not allowed to make changes to the database structure, including FKs, PKs, etc.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Drewyd
Starting Member

2 Posts

Posted - 2014-09-17 : 16:11:26
quote:
Originally posted by tkizer

Does your company own the software? If it's a 3rd party app, you typically are not allowed to make changes to the database structure, including FKs, PKs, etc.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/



No, it's maintained by the original builder of the database. I guess the relationship's must be defined in the front end application layer, but with the amount of data discrepancies I have to wonder where they learned their trade! I obviously can't alter the structure at all, but maybe I can come up with some workrounds to help me build reports? (this is what I have been tasked with in the short term)

Drew
Go to Top of Page
   

- Advertisement -