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. General Programming
  3. C#
  4. Problem with Stored Procedure

Problem with Stored Procedure

Scheduled Pinned Locked Moved C#
databasehelpsql-serversysadminregex
2 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.
  • R Offline
    R Offline
    ronin1770
    wrote on last edited by
    #1

    hi, i am writing a simple Stored Procedure [Sql Server 2000] to check employee's login ... this stored procedure.. supposed to return "YES" or "NO.. if login and password match... here is the code for stored procedure : ---------------------------------- CREATE PROCEDURE spCheckEmpLogin @Login char(6), @EmpPassword char(8) , @RetVal char(3) OUTPUT AS DECLARE @tmp char(4) SELECT @tmp = EmpPassword FROM tblEmployees WHERE Login=@Login IF @tmp <> @EmpPassword BEGIN @RetVal = 'NO' END RETURN; GO --------------------------------------- when i click on "Check Syntax" button.... server returns this error : Error 170: Line 11 : Incorrect Syntax near '@RetVal' ...................................................... well ... in line 11 : i am assigning 'No' to @RetVal... [it's a simple assignment].... can you please tell me what i am doing wrong???? thanx in advance

    J 1 Reply Last reply
    0
    • R ronin1770

      hi, i am writing a simple Stored Procedure [Sql Server 2000] to check employee's login ... this stored procedure.. supposed to return "YES" or "NO.. if login and password match... here is the code for stored procedure : ---------------------------------- CREATE PROCEDURE spCheckEmpLogin @Login char(6), @EmpPassword char(8) , @RetVal char(3) OUTPUT AS DECLARE @tmp char(4) SELECT @tmp = EmpPassword FROM tblEmployees WHERE Login=@Login IF @tmp <> @EmpPassword BEGIN @RetVal = 'NO' END RETURN; GO --------------------------------------- when i click on "Check Syntax" button.... server returns this error : Error 170: Line 11 : Incorrect Syntax near '@RetVal' ...................................................... well ... in line 11 : i am assigning 'No' to @RetVal... [it's a simple assignment].... can you please tell me what i am doing wrong???? thanx in advance

      J Offline
      J Offline
      Javier Lozano
      wrote on last edited by
      #2

      Hi, First of all, I think you posted this message in the wrong message board (this is C#). In answer to your question, line 11 should read like this: SET @RetVal = 'NO' Hope this helps! ~javier lozano (blog)

      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