April 5, 2004 at 12:43 am
How Can i make relationship between two databases , is there any solution to do that ?
Ex:
I have the following two db's
DBName : DB1
TableName : tblPrj
FieldName : PrjCode
DBName : DB2
TableName: tblAccts
FieldName : PrjCode
now is there is anyway that i can make relationship between the two databases by refering the prjcode field .
Guide me if anyone don eit before.
Thanks.
April 5, 2004 at 1:11 am
- why not put the tables in 1 db (if it is on the same box)? (if you want physical-files per table, use filegroups)
- You can perform the dri-checks you would implement if they were at 1 db with triggers. Support the dri-checking with indexes.
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
April 5, 2004 at 2:42 am
Both the Databases used for two different applications but exists in a single SQL Server , i want to make some constraints , incase if there is any deletion in my first Db for the value PrjCode then it should check it in my DB2 also. IS there any sollution really to do like setting relationships .
April 5, 2004 at 3:51 am
1) it's not because there are # of applications, that you would need # of db.
you can arrange it all using authorities.
2) if not on the same db or server, you 'll need to provide your own triggers to perform the dri-checking.
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
April 6, 2004 at 12:34 am
Can you give me any sample of triggers which refers two fields from two databases at the time of insert , update or delete , provide me if u have any samples.
Thanks.
April 6, 2004 at 12:52 am
CREATE TRIGGER TrU_T_Server ON T_Server
FOR delete
AS
if exists (select * from userdb2.dbo.T_ServerDB B
inner join inserted I
on B.idnrserver = I.idnr )
begin
raiserror("There are still dependant rows" ,16,1)
end
go
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
April 6, 2004 at 2:21 am
Thanks a lot alzdba , Thanks again for your support and i learnt a new technique today with your help.
Thks,
Arun.
April 6, 2004 at 3:00 am
Youre welcome, thats what this group is all about
Actualy, there's a little bug because a for delete trigger only has the deleted object available :
CREATE TRIGGER TrU_T_Server ON T_Server
FOR delete
AS
if exists (select * from userdb2.dbo.T_ServerDB B
inner join deleted I
on B.idnrserver = I.idnr )
begin
raiserror("There are still dependant rows" ,16,1)
end
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply