Red Gate forums :: View topic - DataCompare with a WHERE to only get FK rows of lower tables
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Compare Previous Versions
SQL Data Compare Previous Versions forum

DataCompare with a WHERE to only get FK rows of lower tables

Search in SQL Data Compare Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
ccupp@petroweb.com



Joined: 05 May 2011
Posts: 3

PostPosted: Fri Jul 15, 2011 5:13 pm    Post subject: DataCompare with a WHERE to only get FK rows of lower tables Reply with quote

I have a database w/ about 20 tables.

There is one table that is basically at the top of the Pyramid.

I want to do a SQL DataCompare where I only get FK rows in child tables..

Lets Assume A is Top Table and B is Child Table.

I have 10 rows in Table A and 100 in Table B.

Right now when I do a Where a.rowid = 1, my script still returns all rows in Table B. I only want to get the 10 rows in TableB with a FKID of 1.

I have tried unchecking "Disable Foreign Keys" in the Options Tab, but that didn't seem to help
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Mon Jul 18, 2011 1:41 pm    Post subject: Reply with quote

Thanks for your post.

It sounds like you need to put the where clause on table b. e.g.

b.FKID = 1
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
ccupp@petroweb.com



Joined: 05 May 2011
Posts: 3

PostPosted: Mon Jul 18, 2011 3:36 pm    Post subject: Reply with quote

Yes, I could do that.. but with 20 tables.. keeping track of 20 Guids is exactly what I was trying to avoid.. If I have to keep track of all 20 Guids.. then I might as well just go through each table and restrict them by hand instead of using a where clause... but i was hoping to avoid that, as I tend to make errors when I copy and paste all those GUIDs around. Smile

casey
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group