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.
| Author |
Topic |
|
swenri
Yak Posting Veteran
72 Posts |
Posted - 2006-07-17 : 09:35:16
|
| Iam having a prob. I need to select the data from 4 tables. Hi,Iam having a problem, when ever I run a query on my system, I get 364 records and when I run the same on another system which is the testing system, Iam getting 2803 records. Why is the difference ?This is for reports using crystal reports and the back end is Sql srever 2000.The query that I used is SELECT d.donrid,n.nameplural,n.namecsalut,a.addrline1,a.addrline2,a.addrline3,a.addrcity,a.addrplace,a.addrzipcod,atr.attrtypenm,atr.attrdescr1,atr.attrpositn,a.addraltph,atr.attrcomm,atr.attrstop FROM corebio_full AS c INNER JOIN donor_full AS dON c.coreid = d.donrid INNER JOIN name_full AS nON d.donrid= n.nameid INNER JOIN address_full AS aON d.donrid = a.addrid INNER JOIN attribute_full AS atrON d.donrid = atr.attridWHERE atr.attrtype ='star'and n.nametype ='a',Now my question is whether an unique key constraint can be created on a foreign key constraint? Coreid has a primary key constraint, donrid has a foreign key constraint. |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-07-17 : 09:41:54
|
| do the tables have the same data?do the tables have the schema/type definitions,defaults?do the tables have the same constraints?--------------------keeping it simple... |
 |
|
|
swenri
Yak Posting Veteran
72 Posts |
Posted - 2006-07-17 : 09:46:42
|
| Yes they have the same data. They have the same constraints. |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-07-17 : 10:03:16
|
| just to be sure, take a backup of the '364' system and restore it with a different name on the testing system, run your query--------------------keeping it simple... |
 |
|
|
|
|
|
|
|