Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL 2005 There is already an object named ... No there isn't! 1

Status
Not open for further replies.

SJG0526

Programmer
Joined
Jul 5, 2002
Messages
108
Location
US
Trying to run the following script in SQL Server 2005. The syntax checks out fine but when I execute it I get:

Msg 2714, Level 16, State 3, Procedure ehe_ConditionSubForm, Line 22
There is already an object named 'ehe_ConditionSubForm' in the database.

There is NO stored proc or anything else with that name. I changed the name and it ran without errors but I couldn't find the procedure with the new name! Anyone know whats going on here?


Code:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE ehe_ConditionSubForm
	@iGrpFilter int = 0
AS
BEGIN
	SET NOCOUNT ON;

	SELECT LS.[CnCode], LS.[SvyNumber], 
	LS.[Answer], LS.[Date], LS.[Initials],
	LC.[Category], LC.[Condition], LC.[Action],
	LS.[Comment], LC.[Regulation], LC.[Order1]
	FROM tblLabSurveyCondition AS LS INNER JOIN tblListCondition AS LC ON 
	tblLabSurveyCondition.[CnCode] = tblListCondition.[ID]
	WHERE (LS.Answer=3 And @iGrpFilter=3) 
	Or (@iGrpFilter=1)
	ORDER BY tblListCondition.[Order1]
END

GO
 
maybe it's in the master database

you may need to use the USE statement to select the database you're creating in

r937.com | rudy.ca
 
Ahhhhh. Thank you!!! That was it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top