7f6c33e87c
use Scope identity rather than scope
16 lines
338 B
Transact-SQL
16 lines
338 B
Transact-SQL
CREATE PROCEDURE [dbo].[spSaleInsert]
|
|
@Id int output,
|
|
@CashierId nvarchar(128),
|
|
@SaleDate datetime2,
|
|
@SubTotal money,
|
|
@Tax money,
|
|
@Total money
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON;
|
|
|
|
INSERT INTO dbo.Sale(CashierId, SaleDate, SubTotal, Tax, Total)
|
|
VALUES (@CashierId, @SaleDate, @SubTotal, @Tax, @Total);
|
|
|
|
SELECT @Id = Scope_IDENTITY();
|
|
END |