SQL跨库查询
扫描二维码
随时随地手机看文章
实例:
create procedure getStatusCompanyExample
@statusValue int,
@CompanyName nvarchar(50)
AS
BEGIN
select *from IKCExamples.dbo.IKCExamples as A,IKCExamples.dbo.Examples as B,IKCUser.dbo.userinfo as C
where A.id=B.exampleid and B.status=@statusValue and A.userid=C.userid and C.company_name=@CompanyName
END
需要注意的就是在参数类型确定上一定要和,要与之匹配的列的属性相一致就好