create proc test(@CustomerID int,@ProductID int)
as
  select *
  from Po表 A inner join PODetails表 B on B.POID = A.POID
  where A.CustomerID=@CustomerID and B.ProductID=@ProductID

解决方案 »

  1.   

    create proc p_sql
    @CustomerID int,
    ProductID int
    as
    select * from poid a inner join PODetails b on a.POID=b.POID
    where a.CustomerID=@CustomerID and b.ProductID=@ProductID
    go
      

  2.   

    create proc SP_Find(@CustomerID int,@ProductID int)
    as
      select *
      from Po A inner join PODetails B on B.POID = A.POID
      where A.CustomerID=@CustomerID and B.ProductID=@ProductID
      

  3.   

    create proc good
    @CustomerID int,
    @ProductID int
    as
    select * from PO a,PODetails b where a.POID=b.POID
    and a.CustomerID=@CustomerID and b.ProductID=@ProductID
    go