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 |
|
lesbail
Starting Member
3 Posts |
Posted - 2009-02-06 : 05:07:43
|
| I have managed with help from the forum thxto create a view of all my databases together by using the following script:-SELECT agroup.scheme.slitemm.customer, agroup.scheme.slitemm.item_no, agroup.scheme.slitemm.refernce, agroup.scheme.slitemm.dated, agroup.scheme.slitemm.due_date, agroup.scheme.slitemm.kind, agroup.scheme.slitemm.amount, agroup.scheme.slitemm.currency_amount, agroup.scheme.slitemm.vat_amount, agroup.scheme.slitemm.open_indicator, agroup.scheme.slitemm.customer_order_num, agroup.scheme.slitemm.effective_date, agroup.scheme.slitemm.order_customer, agroup.scheme.slitemm.spare, agroup.scheme.slcustm.nameFROM agroup.scheme.slitemm CROSS JOIN agroup.scheme.slcustmWHERE (agroup.scheme.slitemm.open_indicator = 'O')UNION ALLSELECT slitemm_1.customer, slitemm_1.item_no, slitemm_1.refernce, slitemm_1.dated, slitemm_1.due_date, slitemm_1.kind, slitemm_1.amount, slitemm_1.currency_amount, slitemm_1.vat_amount, slitemm_1.open_indicator, slitemm_1.customer_order_num, slitemm_1.effective_date, slitemm_1.order_customer, slitemm_1.spare, slcustm_1.nameFROM emerg1.scheme.slitemm AS slitemm_1 CROSS JOIN emerg1.scheme.slcustm AS slcustm_1WHERE (slitemm_1.open_indicator = 'O')Unfortunately I am getting duplicates from my databases I know this will be a join issue but dont know enough about sql to find the answer.Any help woud be much appreciatedThanks in advanceLes |
|
|
Jai Krishna
Constraint Violating Yak Guru
333 Posts |
Posted - 2009-02-06 : 05:08:54
|
quote: Originally posted by lesbail I have managed with help from the forum thxto create a view of all my databases together by using the following script:-SELECT agroup.scheme.slitemm.customer, agroup.scheme.slitemm.item_no, agroup.scheme.slitemm.refernce, agroup.scheme.slitemm.dated, agroup.scheme.slitemm.due_date, agroup.scheme.slitemm.kind, agroup.scheme.slitemm.amount, agroup.scheme.slitemm.currency_amount, agroup.scheme.slitemm.vat_amount, agroup.scheme.slitemm.open_indicator, agroup.scheme.slitemm.customer_order_num, agroup.scheme.slitemm.effective_date, agroup.scheme.slitemm.order_customer, agroup.scheme.slitemm.spare, agroup.scheme.slcustm.nameFROM agroup.scheme.slitemm CROSS JOIN agroup.scheme.slcustmWHERE (agroup.scheme.slitemm.open_indicator = 'O')UNION ALLSELECT slitemm_1.customer, slitemm_1.item_no, slitemm_1.refernce, slitemm_1.dated, slitemm_1.due_date, slitemm_1.kind, slitemm_1.amount, slitemm_1.currency_amount, slitemm_1.vat_amount, slitemm_1.open_indicator, slitemm_1.customer_order_num, slitemm_1.effective_date, slitemm_1.order_customer, slitemm_1.spare, slcustm_1.nameFROM emerg1.scheme.slitemm AS slitemm_1 CROSS JOIN emerg1.scheme.slcustm AS slcustm_1WHERE (slitemm_1.open_indicator = 'O')Unfortunately I am getting duplicates from my databases I know this will be a join issue but dont know enough about sql to find the answer.Any help woud be much appreciatedThanks in advanceLes
Jai Krishna |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|
|
|