why it is not work
-
i write store procedure for the time .it insert time in the database before inserting it check this time is already exit or not .if exit it not allow me to insert and rasise error butit not work it give error on starting "begin" statement i don't understand where i am doing wrong someone help me to reconver this error CREATE PROCEDURE InsertTiming(@timing nvarchar(255)) BEGIN SET NOCOUNT ON; -- Check if timing already exists DECLARE @tmp nvarchar(255); SELECT @tmp = s_time FROM timing WHERE s_time = @timing; IF @tmp IS NOT NULL BEGIN raiserror(N'Timing %s already assigned', 10, 1, @timing); END -- Insert new value INSERT INTO timing(s_test) VALUES (@timing); END
okey
-
i write store procedure for the time .it insert time in the database before inserting it check this time is already exit or not .if exit it not allow me to insert and rasise error butit not work it give error on starting "begin" statement i don't understand where i am doing wrong someone help me to reconver this error CREATE PROCEDURE InsertTiming(@timing nvarchar(255)) BEGIN SET NOCOUNT ON; -- Check if timing already exists DECLARE @tmp nvarchar(255); SELECT @tmp = s_time FROM timing WHERE s_time = @timing; IF @tmp IS NOT NULL BEGIN raiserror(N'Timing %s already assigned', 10, 1, @timing); END -- Insert new value INSERT INTO timing(s_test) VALUES (@timing); END
okey
MSDN : CREATE PROCEDURE[^] In short, you're missing the AS keyword before BEGIN.
SG Cause is effect concealed. Effect is cause revealed.
-
i write store procedure for the time .it insert time in the database before inserting it check this time is already exit or not .if exit it not allow me to insert and rasise error butit not work it give error on starting "begin" statement i don't understand where i am doing wrong someone help me to reconver this error CREATE PROCEDURE InsertTiming(@timing nvarchar(255)) BEGIN SET NOCOUNT ON; -- Check if timing already exists DECLARE @tmp nvarchar(255); SELECT @tmp = s_time FROM timing WHERE s_time = @timing; IF @tmp IS NOT NULL BEGIN raiserror(N'Timing %s already assigned', 10, 1, @timing); END -- Insert new value INSERT INTO timing(s_test) VALUES (@timing); END
okey