General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Script won't create a stored procedure
Hell Group,
The script has a cursor in it named maxgpa. I get the error message "Could not find table maxgpa. Will try to resolve this table later. The script doesn't put the stored procedure into the database.
The script is:
/****** Object: Stored Procedure dbo.sp_gpahist Script Date: 4/12/2002 9:46:42 AM ******/
if exist stuff deleted..
CREATE PROCEDURE sp_gpahist
AS
if exists (select * from sysobjects where id = object_id(N'[dbo].[cisgpahist]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[cisgpahist]
DECLARE MaxGPA CURSOR
FOR
SELECT MAX(dbo.gpahist.gpauniq) AS gpauniq,
dbo.gpahist.suniq
FROM dbo.jw1_distinct_suniq_for_Career_Center INNER JOIN
dbo.gpahist ON
dbo.jw1_distinct_suniq_for_Career_Center.suniq = dbo.gpahist.suniq
GROUP BY dbo.gpahist.suniq
OPEN MaxGPA
SELECT dbo.gpahist.suniq, gpahist.cumgpa
INTO cisgpahist
FROM maxgpa INNER JOIN
dbo.gpahist ON maxgpa.gpauniq = dbo.gpahist.gpauniq
CLOSE MAXGPA
DEALLOCATE MAXGPA
GO
SET QUOTED_IDENTIFIER OFF SET ANSI_NULLS ON
GO
how do i fix this??
Thank you very much
Jim
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only