create proc procname
@id int
as
insert into dba..tablea select * from dbb..tablea where id=@id
insert into dba..tableb select * from dbb..tableb where id=@id
go
create proc test
@id int
as
insert into dbA..tablea select * from dbB..tablea where id=@id
insert into dbA..tableb select * from dbB..tableb where id=@id
create proc p_test @id int
as
insert into dbA..tablea select * from dbB..tablea where id=@id
insert into dbA..tableb select * from dbB..tableb where id=@id
go
use dbB
go
create procedure test @id int
AS
insert dbA..tableA select * from tableA where id = @id
insert dbA..tableB select * from tableB where id = @id
go