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