I have looked through this a number of times this morning and cannot find the issue. Its probably dead simple and I'll feel like an idiot when someone points it out. What would this SQL fail?
-- Get CurrentRowCount
DECLARE @MaxID INT
SELECT @MaxID = ISNULL(MAX(WorkTypeID),0)
FROM caWorkType
ALTER TABLE #WorkType ADD _RowID INT NOT NULL IDENTITY(@MaxID,1)
Error I'm getting is: "Incorrect syntax near '@MaxID'" I have checked and @MaxID is being set to 45 by the select statement. The temp table #WorkType also does not have a column named "_RowID"