Why does only the first INSERT statement work???
CREATE PROCEDURE insert_inventory
@item_name varchar(20),
@description varchar(100),
@notes varchar(255),
@amount varchar(8)
AS
DECLARE @item_id int
DECLARE @transaction_date datetime
IF (@item_name = '') SET @item_name = NULL
IF (@description = '') SET @description = NULL
IF (@notes = '') SET @notes = NULL
IF (@amount = '') SET @amount = NULL
SET @item_id = IDENT_CURRENT('inventory')
SET @transaction_date = GETDATE()
INSERT INTO inventory (item_name, item_description, notes) VALUES (@item_name, @description, @notes)
INSERT INTO expenditure (item_id, transaction_date, amount) VALUES (@item_id, @transaction_date, CAST(@amount AS money))
CREATE PROCEDURE insert_inventory
@item_name varchar(20),
@description varchar(100),
@notes varchar(255),
@amount varchar(8)
AS
DECLARE @item_id int
DECLARE @transaction_date datetime
IF (@item_name = '') SET @item_name = NULL
IF (@description = '') SET @description = NULL
IF (@notes = '') SET @notes = NULL
IF (@amount = '') SET @amount = NULL
SET @item_id = IDENT_CURRENT('inventory')
SET @transaction_date = GETDATE()
INSERT INTO inventory (item_name, item_description, notes) VALUES (@item_name, @description, @notes)
INSERT INTO expenditure (item_id, transaction_date, amount) VALUES (@item_id, @transaction_date, CAST(@amount AS money))