Groups | Blog | Home
all groups > sql server clients > july 2003 >

sql server clients : Could not find stored procedure : Server: Msg 2812


Allan Mitchell
7/30/2003 11:14:55 AM
Have you tried wrapping the @SQLStatement in ()

Exec @SQLStatement is looking to EXECUTE a stored proc not a statement


i.e.

declare @s varchar(100)
set @s = 'select count(*) from response'
exec @s

Server: Msg 2812, Level 16, State 62, Line 3
Could not find stored procedure 'select count(*) from response'.

declare @s varchar(100)
set @s = 'select count(*) from response'
exec (@s)


-----------
630300

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



[quoted text, click to view]

Farhan Iqbal
7/30/2003 2:44:59 PM
hi all,

I writes the following procedure which is update the specific table
according to given parameters. But I have no idea why it is giving error
like

Server: Msg 2812, Level 16, State 62, Line 35

Could not find stored procedure 'Update Browser_tbl set Browser_Desc = 'New
Browser' Where Browser_Code = 4'.



CREATE Procedure Update_Browser_tbl (@vBrowser_Desc varchar(100), @Is_Active
char, @Browser_Code int) as

Begin

Declare @SQLStatement varchar(8000), @flag int

Begin

set @flag = 0

Select @SQLStatement = 'Update Browser_tbl set '

if @vBrowser_Desc is not null

begin

if @flag = 0

begin

set @SQLStatement = @SQLStatement +
'Browser_Desc = '''+@vBrowser_Desc+''''

End

if @flag = 1

begin

set @SQLStatement = @SQLStatement + ',
Browser_Desc = '''+@vBrowser_Desc+''''

end

set @flag = 1

end



if @Is_Active is not null

begin

if @flag = 0

begin

set @SQLStatement = @SQLStatement +
'Is_Active = '''+@Is_Active+''''

End

if @flag = 1

begin

set @SQLStatement = @SQLStatement + ',
Is_Active = '''+@Is_Active+''''

end

set @flag = 1

end



set @SQLStatement = @SQLStatement + ' Where Browser_Code =
'+convert(varchar(10), @Browser_Code)



Exec @SQLStatement



End

End



Plz help...



Farhan Iqbal









Farhan Iqbal
7/30/2003 3:26:27 PM
Thanx Mitchell it's working now



[quoted text, click to view]

AddThis Social Bookmark Button