dbTalk Databases Forums  

what is the difference in the FK properties

microsoft.public.sqlserver.programming microsoft.public.sqlserver.programming


Discuss what is the difference in the FK properties in the microsoft.public.sqlserver.programming forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sparks
 
Posts: n/a

Default what is the difference in the FK properties - 04-05-2012 , 08:48 AM






I finished all the merging and inserting of the database I have been
working on and made a copy of the final and a backup


anyway I was trying compare from redcraft

I found this comparing the empty database I started with and the
final.

ALTER TABLE [dbo].[QuestionnaireData] ADD CONSTRAINT
[FK_QuestionnaireData_ClientID] FOREIGN KEY ([ClientID]) REFERENCES
[dbo].[Client] ([ClientID])

ALTER TABLE [dbo].[QuestionnaireData] ADD CONSTRAINT
[QuestionnaireData_ClientID_FK] FOREIGN KEY ([ClientID]) REFERENCES
[dbo].[Client] ([ClientID])


I don't know much about this but why is FK at the start of the
statement in the original FK_QuestionnaireData_ClientID
and at the end in the final QuestionnaireData_ClientID_FK

Reply With Quote
  #2  
Old   
sparks
 
Posts: n/a

Default Re: what is the difference in the FK properties - 04-05-2012 , 08:50 AM






Sorry I ment to say the compare in Redgate not redcraft


On Thu, 05 Apr 2012 08:48:01 -0500, sparks <sparks (AT) home (DOT) com> wrote:

Quote:
I finished all the merging and inserting of the database I have been
working on and made a copy of the final and a backup


anyway I was trying compare from redcraft

I found this comparing the empty database I started with and the
final.

ALTER TABLE [dbo].[QuestionnaireData] ADD CONSTRAINT
[FK_QuestionnaireData_ClientID] FOREIGN KEY ([ClientID]) REFERENCES
[dbo].[Client] ([ClientID])

ALTER TABLE [dbo].[QuestionnaireData] ADD CONSTRAINT
[QuestionnaireData_ClientID_FK] FOREIGN KEY ([ClientID]) REFERENCES
[dbo].[Client] ([ClientID])


I don't know much about this but why is FK at the start of the
statement in the original FK_QuestionnaireData_ClientID
and at the end in the final QuestionnaireData_ClientID_FK

Reply With Quote
  #3  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: what is the difference in the FK properties - 04-05-2012 , 10:27 AM



On Thu, 05 Apr 2012 08:48:01 -0500, sparks <sparks (AT) home (DOT) com> wrote:

[snip]

Quote:
I don't know much about this but why is FK at the start of the
statement in the original FK_QuestionnaireData_ClientID
and at the end in the final QuestionnaireData_ClientID_FK
It is simply a different naming convention. I tend to go with
the first style of categorising at the beginning myself.

Sincerely,

Gene Wirchenko

Reply With Quote
  #4  
Old   
sparks
 
Posts: n/a

Default Re: what is the difference in the FK properties - 04-05-2012 , 11:17 AM



Thank you for that.

the compare showed they didn't match.
and that was the only difference between the two.

I could not fngure out how copying the database would generate that
difference.


On Thu, 05 Apr 2012 08:27:35 -0700, Gene Wirchenko <genew (AT) ocis (DOT) net>
wrote:

Quote:
On Thu, 05 Apr 2012 08:48:01 -0500, sparks <sparks (AT) home (DOT) com> wrote:

[snip]

I don't know much about this but why is FK at the start of the
statement in the original FK_QuestionnaireData_ClientID
and at the end in the final QuestionnaireData_ClientID_FK

It is simply a different naming convention. I tend to go with
the first style of categorising at the beginning myself.

Sincerely,

Gene Wirchenko

Reply With Quote
  #5  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: what is the difference in the FK properties - 04-05-2012 , 11:41 AM



On Thu, 05 Apr 2012 11:17:25 -0500, sparks <sparks (AT) home (DOT) com> wrote:

Quote:
Thank you for that.

the compare showed they didn't match.
and that was the only difference between the two.

I could not fngure out how copying the database would generate that
difference.
Nor can I. something else is happening besides just copying.

[snip - Please do not top post.]

Sincerely,

Gene Wirchenko

Reply With Quote
  #6  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: what is the difference in the FK properties - 04-05-2012 , 04:48 PM



sparks (sparks (AT) home (DOT) com) writes:
Quote:
I could not fngure out how copying the database would generate that
difference.
Corruption can always occur - but no that difference is not due to
corruption, but it is due to intervention by human hands - may be you?


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Reply With Quote
  #7  
Old   
sparks
 
Posts: n/a

Default Re: what is the difference in the FK properties - 04-09-2012 , 08:36 AM



It is simply a different naming convention.

can you tell me what was done by human hands to generate the
difference?

On Thu, 05 Apr 2012 23:48:09 +0200, Erland Sommarskog
<esquel (AT) sommarskog (DOT) se> wrote:

Quote:
sparks (sparks (AT) home (DOT) com) writes:
I could not fngure out how copying the database would generate that
difference.

Corruption can always occur - but no that difference is not due to
corruption, but it is due to intervention by human hands - may be you?

Reply With Quote
  #8  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: what is the difference in the FK properties - 04-09-2012 , 08:59 AM



sparks (sparks (AT) home (DOT) com) writes:
Quote:
can you tell me what was done by human hands to generate the
difference?
You mean that I from a distance should say exactly what you did to achieve
the duplicate constraints?

All I can say is that someone(s) used different name for the same constraint
at different points in time.

--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Reply With Quote
  #9  
Old   
sparks
 
Posts: n/a

Default Re: what is the difference in the FK properties - 04-16-2012 , 10:43 AM



All I can say is that someone(s) used different name for the same
constraint
at different points in time.


thank you.

I asked the people that this was sent to and they said that one fk was
not correct.

SO it didn't work?
No it just didn't show up in our mapping so we added it.
you mean the graphical view?
yes.

so that is where they got it.
I don't know why they said it didn't show up I can only assume that
some how it broke it when they restored it because it looks fine here.

overall this has been a big learning experience. I think the main
problem to me was working with a production database and trying to
keep everything the same but then finding things impossible to merge
and insert when you could not retain values since the fields were not
the same.

thanks again for this and all the help from everyone here.



On Mon, 09 Apr 2012 15:59:16 +0200, Erland Sommarskog
<esquel (AT) sommarskog (DOT) se> wrote:

Quote:
sparks (sparks (AT) home (DOT) com) writes:
can you tell me what was done by human hands to generate the
difference?

You mean that I from a distance should say exactly what you did to achieve
the duplicate constraints?

All I can say is that someone(s) used different name for the same constraint
at different points in time.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.