Hi all,
Im really stumped with this...im new to T-SQL and trying to write a stored procedure. This is my code:
CREATE PROCEDURE SetStrandState
@pCableName varchar(50),
@pStartStrand int,
@pEndStrand int,
@pStrandState int,
@pComment varchar(80),
@pUser varchar(25)
AS
DECLARE
@OutputMsg varchar(255),
@CurrentStrand int,
@StrandStateDesc varchar(25),
@StartStrand int,
@EndStrand int
select @StrandStateDesc = dbo.state.condition from dbo.state where dbo.state.stateid=@pStrandState
GO
set @StartStrand = @pStartStrand
set @EndStrand = @pEndStrand
...the whole thing so far will parse except last two lines, i get messages saying pStartStrand & pEndStrand must be declared!
What am i doing wrong? Im on SQL server 2000 also.
Thanks
Im really stumped with this...im new to T-SQL and trying to write a stored procedure. This is my code:
CREATE PROCEDURE SetStrandState
@pCableName varchar(50),
@pStartStrand int,
@pEndStrand int,
@pStrandState int,
@pComment varchar(80),
@pUser varchar(25)
AS
DECLARE
@OutputMsg varchar(255),
@CurrentStrand int,
@StrandStateDesc varchar(25),
@StartStrand int,
@EndStrand int
select @StrandStateDesc = dbo.state.condition from dbo.state where dbo.state.stateid=@pStrandState
GO
set @StartStrand = @pStartStrand
set @EndStrand = @pEndStrand
...the whole thing so far will parse except last two lines, i get messages saying pStartStrand & pEndStrand must be declared!
What am i doing wrong? Im on SQL server 2000 also.
Thanks