Skip to Content
0
Former Member
Apr 07, 2014 at 07:34 PM

can't alter existing procdure

19 Views

Try to modify existing proc with following script:

Alter PROCEDURE dbo.p1
(
@p1 int,
@p2 univarchar(2),
@p2 univarchar(10),
@p3 univarchar(10),
@p4 univarchar(12),
@p5 bit = 0
)
AS
BEGIN

....

END

got error:

Incorrect syntax near the keyword 'PROCEDURE'.

Must declare variable '@p3datefrom'.

Must declare variable '@p1'.

Must declare variable '@p2'.

but it is okay with create:

Create PROCEDURE dbo.p1
(
@p1 int,
@p2 univarchar(2),
@p2 univarchar(10),
@p3 univarchar(10),
@p4 univarchar(12),
@p5 bit = 0
)
AS
BEGIN

....

END

Confused. how to resolve it?