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
/****** Usage:
exec test 10
********/

解决方案 »

  1.   

    create proc @id int
    as
    insert dba..tablea select * from dbb..tablea where id=@id
    insert dba..tableb select * from dbb..tableb where id=@id
      

  2.   

    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
      

  3.   

    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
      

  4.   

    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