Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 must define scalar variable

Author  Topic 

shraddhapatel
Starting Member

3 Posts

Posted - 2011-04-20 : 03:00:05
USE [online shopping]
GO
/****** Object: StoredProcedure [dbo].[sp_osc_category_insert] Script Date: 04/20/2011 11:26:44 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO




ALTER procedure [dbo].[sp_osc_category_insert]


@cat_id int output,
@cat_name varchar(50),
@cat_desc varchar(100),
@parent_id int,
@subcat_id int,
@cat_date datetime,
@cat_isactive varchar(1)



as
insert into osc_category
(
cat_name,
cat_desc,
parent_id,
subcat_id,
cat_date,
cat_isactive
)
values(

@cat_name,
@cat_desc,
@parent_id,
@subcat_id,
@cat_date,
@cat_isactive
)



SELECT @cat_id =SCOPE_IDENTITY()







error is:
Msg 137, Level 15, State 2, Line 12
Must declare the scalar variable "@cat_name".
Msg 137, Level 15, State 1, Line 22
Must declare the scalar variable "@cat_id".


plz reply

shraddhapatel
Starting Member

3 Posts

Posted - 2011-04-20 : 03:05:46
i have error in this stored procedure not view data in view form by id

shraddha
Go to Top of Page

raghuveer125
Constraint Violating Yak Guru

285 Posts

Posted - 2011-04-20 : 03:27:08
When you are getting error? During procedure create or calling procedure!


Raghu' S
Go to Top of Page

shraddhapatel
Starting Member

3 Posts

Posted - 2011-04-20 : 09:09:44
calling procedure


shraddha
Go to Top of Page
   

- Advertisement -