We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Error in stored procedures

Thread ID:

Created:

Updated:

Platform:

Replies:

60157 Apr 28,2007 09:48 AM May 2,2007 06:02 AM ASP.NET Web Forms (Classic) 1
loading
Tags: FAQ
wrkrishna
Asked On April 28, 2007 09:48 AM

Hi I am trying to create a simple view using a stored procedure. But everytime i try to create the procedure it is displaying an error

here is my code
***********************

USE crm
go
create procedure Update_Proc
as
begin

IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS

WHERE TABLE_NAME = 'Update_View' )

DROP VIEW Update_View

GO

CREATE VIEW Update_View

AS

select compid,service_req,reg_at,reg_by,exp_time,zone,ambulance.mobile
from complaints,ambulance

go

*********************************

it is showing the following error!

incorrect syntax near Update_View

how can i resolve this

kindly help
ravi.

Poornima Joy Balan [Syncfusion]
Replied On May 2, 2007 06:02 AM

Hello,

Here's the modified stored prodecure.

USE crm
go
create procedure Update_Proc
as
IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME = 'Update_View' )
DROP VIEW Update_View
GO
CREATE VIEW Update_View
AS
select compid,services_req,req_at,reg_by,exp_time,zone,ambulance.mobile
from complaints,ambulance
go

Please remove the 'begin' from your stored procedure. Let me know, any further queries.

Regards,
Poornima

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;