我要发出一张销售发票创建了四张表格:(在stimulsoft中发送变量)如何加入四张发票表格?
我该如何使用该过程将这些表格连接在一起?
这些都是表:
这是程序:
USE [RahgoshafanDB]
GO
/****** Object: StoredProcedure [dbo].[Invoice_Soft] Script Date: 05/19/2015 10:30:26 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE Procedure [dbo].[Invoice_Soft]
@Invoice_Id int
AS
BEGIN
select
dbo.Customer.Customer as customer,
dbo.Customer.Tel as tel,
dbo.Customer.Adr as adr,
dbo.Software_Invoice.Dat as dat,
dbo.Software_Invoice.Payable as payable,
dbo.Software_Invoice.Discount as discount,
dbo.Software.Software as software,
dbo.Software_Order.Price as price,
dbo.Software_Order.Quantity as quantity,
dbo.Software_Order.Sum as sum
From dbo.Software_Invoice inner join dbo.Customer
on dbo.Software_Invoice.Customer_Id = dbo.Customer.Id AND
dbo.Software_Invoice.Id = dbo.Software_Order.Invoice_Id
where dbo.Software_Invoice.Id = @Invoice_Id
END
,但它不工作!
问题解决了 非常感谢Njal! –