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. error in sql

error in sql

Scheduled Pinned Locked Moved Database
databasetoolshelp
3 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.
  • M Offline
    M Offline
    mandarapu
    wrote on last edited by
    #1

    hai, i had wrote one storedprocedure for deleting the current leaves.but when i am debugging i am getting the error as invalid object name.i am posting the code. USE [HDCHRMSDB] GO /****** Object: StoredProcedure [dbo].[apDeleteCurrentYearLeaveSummery] Script Date: 01/04/2011 12:23:41 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER Procedure [dbo].[apDeleteCurrentYearLeaveSummery] As BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; DELETE FROM CurrentYearLeaveSummery Where Year=2011 END please suggest any answer to avoid that error.urgent for me.

    B H 2 Replies Last reply
    0
    • M mandarapu

      hai, i had wrote one storedprocedure for deleting the current leaves.but when i am debugging i am getting the error as invalid object name.i am posting the code. USE [HDCHRMSDB] GO /****** Object: StoredProcedure [dbo].[apDeleteCurrentYearLeaveSummery] Script Date: 01/04/2011 12:23:41 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER Procedure [dbo].[apDeleteCurrentYearLeaveSummery] As BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; DELETE FROM CurrentYearLeaveSummery Where Year=2011 END please suggest any answer to avoid that error.urgent for me.

      B Offline
      B Offline
      Bernhard Hiller
      wrote on last edited by
      #2

      "Year" could be a reserved word. If you have a column with that name, use [Year] instead. Otherwise, it is a function, i.e. Year([My Column]).

      1 Reply Last reply
      0
      • M mandarapu

        hai, i had wrote one storedprocedure for deleting the current leaves.but when i am debugging i am getting the error as invalid object name.i am posting the code. USE [HDCHRMSDB] GO /****** Object: StoredProcedure [dbo].[apDeleteCurrentYearLeaveSummery] Script Date: 01/04/2011 12:23:41 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER Procedure [dbo].[apDeleteCurrentYearLeaveSummery] As BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; DELETE FROM CurrentYearLeaveSummery Where Year=2011 END please suggest any answer to avoid that error.urgent for me.

        H Offline
        H Offline
        Hiren solanki
        wrote on last edited by
        #3

        First of all it's a Repost[^]. I think answer you've got of adding dbo.[name of table] may solve your problem. Rather then posting code in different forum Discuss with people answered you over there.

        Regards, Hiren.

        My Recent Article: - Way to know which control have raised a postback
        My Recent Tip/Trick: - Building Hierarchy using Recursive CTE

        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