| Author |
Message |
ccupp@petroweb.com
Joined: 05 May 2011 Posts: 3
|
Posted: Fri Jul 15, 2011 5:13 pm Post subject: DataCompare with a WHERE to only get FK rows of lower tables |
|
|
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 |
|
 |
Chris Auckland
Joined: 24 Oct 2006 Posts: 710 Location: Red Gate Software Ltd.
|
Posted: Mon Jul 18, 2011 1:41 pm Post subject: |
|
|
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 |
|
 |
ccupp@petroweb.com
Joined: 05 May 2011 Posts: 3
|
Posted: Mon Jul 18, 2011 3:36 pm Post subject: |
|
|
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.
casey |
|
| Back to top |
|
 |
|
|
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