I am trying creat new SP
i get error and i checked the colums and there is no issue
Msg 110, Level 15, State 1, Procedure Insert_States, Line 16 [Batch Start Line 0]
There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
create PROCEDURE [dbo].[Insert_States]
@StateId int,
@CountryId int ,
@StateName nvarchar(MAX)
AS
BEGIN
SET NOCOUNT ON;
IF EXISTS(SELECT StateId FROM States WHERE StateName = @StateName)
BEGIN
SELECT -1 -- StateName exists.
END
ELSE
BEGIN
INSERT INTO States
(
[CountryId],
[StateName]
)
VALUES
(
@CountryId,
@StateName,
GETDATE())
SELECT SCOPE_IDENTITY() -- StateId
END
END