• 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!