Table of Contents
This error message occurs if we use GETDATE() like function as a parameter to Stored Procedure or Function Statement. or the second error is pertaining to problem when inserting data can be solved by making the column not null and also can be made default to some value.
Msg 102, Level 15, State 1, Line 2 Incorrect syntax near ‘)’.’
This problem can be solved by using a local variable for storing the value of Getdate() instead of passing GETDATE() function as parameter directly in the execute statement and then pass the assigned local variable as parameter.
msg 102 level 15 state 1 line 3 incorrect syntax near ' '
This problem when inserting data can be solved by making the column not null and also can be made default to some value.
alter table tablename
add default 0 for person_id
or
alter table TableName
Alter Column ColumnName NOT NULL SET DEFAULT 0
Additional information below:
Please note that alter column may need column to be dropped and re-created which can not useful when table is very large in size
Learn about SQL Server detecting logical consistency based issues and how to resolve them.
Learn about SQL Server error 1222 and how to resolve the lock request time out…
Discover the new features of Microsoft SQL Server 2022 and how they compare to previous…
SQL Server Error 1222 lock request time out period exceeded Lock request time out…
SQL Server Error : 427, Severity: 20. Could not load the definition for constraint ID…
SQL Server Error : 204, Severity: 20. Normalization error in node %ls.
This website uses cookies.