Friday, March 23, 2012

Rebuild Table Daily (sproc)

My goal is to recreate a table daily so that the data is updated. This could be a bad decision performance-wise, but I felt this was simpler than running a daily update statement. I created a stored procedure:

SET QUOTED_IDENTIFIER ON GOSET ANSI_NULLS ON GOCREATE PROCEDURE sp_CreatetblImprintPhraseASDROP TABLE tblImprintPhraseGOCREATE TABLE tblImprintPhrase(CustIDchar(12),CustName varchar(40),TranNoRelchar(15))GO
 However, I was looking to edit the stored procedure, changing CREATE to ALTER, but when I do so, I am prompted with: Error 170: Line 2: Incorrect syntax near "(". If I change back to CREATE, the error goes away, but the sproc cannot be run because it already exists. Any thoughts?
 

To be more specific, is there a proper method to make changes to a stored procedure that already exists? I assumed that swapping the CREATE statement for ALTER would be it, but it has been causing issues.

|||

Simply needed to read more about stored procedures. Batch processes in particular.

No comments:

Post a Comment