Link to home
Start Free TrialLog in
Avatar of ljhodgett
ljhodgett

asked on

error in syntax of stored procedure in mssql server 2005

Hi,

I have the following code in a stored procedure: -

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:            LH
-- Create date: 02/08/02007
-- Description:      Insert where used information into "dbo."
-- =============================================
ALTER procedure [dbo].[Where_Used](
@ProdID varchar(100),
@RigID varchar(100))
AS
BEGIN
   SET NOCOUNT ON
      insert into dbo.Where_Used values(@Prodid, @RigID)
END

but it comes up: -

Msg 2010, Level 16, State 1, Procedure Where_Used, Line 12
Cannot perform alter on 'dbo.Where_Used' because it is an incompatible object type.

How do I resolve this please.

Many Thanks
Lee
Avatar of Lukasz Zielinski
Lukasz Zielinski
Flag of Poland image

you need:
insert into dbo.Where_Used(your_field_name_1, your_field_name2) values (@Prodid, @RigID)

ziolko.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ljhodgett
ljhodgett

ASKER

Hi,

No Joy i'm afraid. I've tried: -

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:            LH
-- Create date: 02/08/02007
-- Description:      Insert where used information into "dbo."
-- =============================================
ALTER procedure [dbo].[Where_Used](
@ProdID varchar(100),
@RigID varchar(100))
AS
BEGIN
   SET NOCOUNT ON
      insert into dbo.Where_Used(ProductID, RigID) values (@Prodid, @RigID)
END

it says line 12 which is the "AS" part of the stored procedure.

Best Regards
Lee
I assume you have tried ziolko's suggestion, but not mine yet...
ooops missed that name conflict

ziolko.