i don't userstand the logic of dropping it and adding it...why not delete, reseed any identities, and insert into again?
your error is due to the fact that
a stored proc cannot have the "GO" command in it;
the "GO" command is actually for SSMS,a nd is not a valid TSQL comand.
removing the GO removes the error:
ALTER PROCEDURE [dbo].[usp_PickHistoryReportTbl]
AS
BEGIN
DECLARE @cmd VARCHAR(MAX)
IF OBJECT_ID('Tbl_PickHist','U') IS NOT NULL
BEGIN
DROP TABLE Tbl_PickHist
CREATE TABLE dbo.Tbl_PickHist
(LastPick datetime,
ComponentItemNumber varchar(50),
IssuedQuantity float)
INSERT INTO dbo.Tbl_PickHist (LastPick,ComponentItemNumber,IssuedQuantity)
SELECT * FROM S_PickHistory2
END --IF
END --PROC
Lowell