Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. why it is not work

why it is not work

Scheduled Pinned Locked Moved Database
helpdatabase
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tittly
    wrote on last edited by
    #1

    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

    S T 2 Replies Last reply
    0
    • T tittly

      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

      S Offline
      S Offline
      SimulationofSai
      wrote on last edited by
      #2

      MSDN : CREATE PROCEDURE[^] In short, you're missing the AS keyword before BEGIN.

      SG Cause is effect concealed. Effect is cause revealed.

      1 Reply Last reply
      0
      • T tittly

        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

        T Offline
        T Offline
        tittly
        wrote on last edited by
        #3

        i use as statement but it give me error on @timing

        okey

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups