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 |
|
ragh
Starting Member
34 Posts |
Posted - 2003-01-06 : 06:33:27
|
| hi !How Can i join 2 tables of similar structures between 2 different databases, and it should return 1 if found eqality or else return 0 if not found.example:Table 1name rollno mark ---------- ----------- ----------- ragh 121 12def 1 1Table 2name rollno mark ---------- ----------- ----------- RAGH 121 12SDF 1 1It should return 1 for RAGH or Return 0 For DEF and SDF !please let me know...!if the procedure is in genereic form then it will be good !regards,Ragh |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2003-01-06 : 06:53:57
|
| select coalesce(a.name, b.name) ,case when a.rollno = b.rollno and a.mark = b.mark then 1 else 0 endfrom db1..tbl afull outer join db2..tbl bon a.name = b.nameYou can create a generic SP by using the system tables to generate a dynamic sql statement using the PK.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|