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. Access violation problem

Access violation problem

Scheduled Pinned Locked Moved Database
databasehelpsql-serversysadminquestion
6 Posts 3 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.
  • J Offline
    J Offline
    jgrogan
    wrote on last edited by
    #1

    Guys, I have a problem with a stored proc in SQL Server 2000. I'm logged in as 'sa' so have complete access to the DB. I have a table defined as follows: CREATE TABLE Conduit ( Index_i int IDENTITY (1,1) NOT NULL Primary Key, Name_vc nvarchar(125) UNIQUE NOT NULL, StartDate_dt datetime ) GO I then have 2 stored procs that access it: CREATE PROCEDURE ReadConduitNames AS BEGIN SET NOCOUNT ON SELECT Name_vc FROM Conduit END GO and CREATE PROCEDURE ReadConduit { @Name_vc nvarchar(125) } AS BEGIN SET NOCOUNT ON SELECT * FROM Conduit WHERE Name_vc = @Name_vc END GO The first stored proc runs fine, but the second one gives the following error: [Microsoft][ODBC SQL Server Driver]Syntax error or access violation I've tried various forums and msdn, but can't find an answer as to why the second stored proc won't load. Any thoughts? Thanks in advance, John.

    B 1 Reply Last reply
    0
    • J jgrogan

      Guys, I have a problem with a stored proc in SQL Server 2000. I'm logged in as 'sa' so have complete access to the DB. I have a table defined as follows: CREATE TABLE Conduit ( Index_i int IDENTITY (1,1) NOT NULL Primary Key, Name_vc nvarchar(125) UNIQUE NOT NULL, StartDate_dt datetime ) GO I then have 2 stored procs that access it: CREATE PROCEDURE ReadConduitNames AS BEGIN SET NOCOUNT ON SELECT Name_vc FROM Conduit END GO and CREATE PROCEDURE ReadConduit { @Name_vc nvarchar(125) } AS BEGIN SET NOCOUNT ON SELECT * FROM Conduit WHERE Name_vc = @Name_vc END GO The first stored proc runs fine, but the second one gives the following error: [Microsoft][ODBC SQL Server Driver]Syntax error or access violation I've tried various forums and msdn, but can't find an answer as to why the second stored proc won't load. Any thoughts? Thanks in advance, John.

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      replace

      jgrogan wrote:

      CREATE PROCEDURE ReadConduit { @Name_vc nvarchar(125) }

      with CREATE PROCEDURE ReadConduit ( @Name_vc nvarchar(125) ) for more info check this google result[^]


      I Love T-SQL "Don't torture yourself,let the life to do it for you."

      J M 2 Replies Last reply
      0
      • B Blue_Boy

        replace

        jgrogan wrote:

        CREATE PROCEDURE ReadConduit { @Name_vc nvarchar(125) }

        with CREATE PROCEDURE ReadConduit ( @Name_vc nvarchar(125) ) for more info check this google result[^]


        I Love T-SQL "Don't torture yourself,let the life to do it for you."

        J Offline
        J Offline
        jgrogan
        wrote on last edited by
        #3

        Many thanks - that worked a treat!

        B 1 Reply Last reply
        0
        • B Blue_Boy

          replace

          jgrogan wrote:

          CREATE PROCEDURE ReadConduit { @Name_vc nvarchar(125) }

          with CREATE PROCEDURE ReadConduit ( @Name_vc nvarchar(125) ) for more info check this google result[^]


          I Love T-SQL "Don't torture yourself,let the life to do it for you."

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          Rename you to Eagle Eyes - well done

          Never underestimate the power of human stupidity RAH

          J 1 Reply Last reply
          0
          • J jgrogan

            Many thanks - that worked a treat!

            B Offline
            B Offline
            Blue_Boy
            wrote on last edited by
            #5

            No problem ;)


            I Love T-SQL "Don't torture yourself,let the life to do it for you."

            1 Reply Last reply
            0
            • M Mycroft Holmes

              Rename you to Eagle Eyes - well done

              Never underestimate the power of human stupidity RAH

              J Offline
              J Offline
              jgrogan
              wrote on last edited by
              #6

              Yeah - I was staring at it for 2 minutes before I realised where the difference was :)

              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