I am trying to add data in single table using a SQL Server stored procedure and I am getting an error
procedure or function x has too many argument specified
Also how can I get newly created ID of record as I need to update multiple tables using these IDs
I am using SQL Server 2012
Many thanks
ALTER PROCEDURE [dbo].[CreateNewFunctionsNavigation]
@FunctionName nvarchar(250),
@Hierarchy_Level int
AS
BEGIN
SET NOCOUNT ON;
INSERT [dbo].[Navigation_Functions] ([FunctionName], [Hierarchy_Level])
VALUES(@FunctionName, @Hierarchy_Level)
END
Execution of stored procedure:
DECLARE @return_value int
EXEC @return_value = [dbo].[CreateNewFunctionsNavigation]
@FunctionName = N'DSD',
@Hierarchy_Level = 3
SELECT 'Return Value' = @return_value
GO
My SQL for Function table
USE [MySolution01_DB]
GO
/****** Object: Table [dbo].[Navigation_Functions] Script Date: 06/01/2015 15:58:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Navigation_Functions](
[Function_ID] [int] IDENTITY(1,1) NOT NULL,
[FunctionName] [nvarchar](250) NOT NULL,
[Hierarchy_Level] [int] NOT NULL,
CONSTRAINT [PK_Functions] PRIMARY KEY CLUSTERED
(
[Function_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO