Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I had written 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.
C++
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



When I am using as Delete from dbo.currentyearleavesummary where year=2011 also it is geeting same error.

In my project currentyearleavesummary is the table exists, even though the error is coming.

Please suggest me a solution.
Please suggest any answer to avoid that error. It is urgent for me.
Posted
Updated 3-Jan-11 23:19pm
v6
Comments
Hiren solanki 4-Jan-11 4:09am    
removed 'urgentz' tag,
Dalek Dave 4-Jan-11 5:19am    
Edited for Grammar, Syntax and Spelling.

put this one
SQL
DELETE FROM DBO.CurrentYearLeaveSummery where Year = 2011


HOPE IT'S THAT SIMPLE ;)
 
Share this answer
 
v2
The schema you are executing does not contain any such tables.
Please verify that which schema contains this table and prefix the schema name like schemaname.tablename
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900