|
-
Sep 25th, 2003, 08:18 AM
#1
Thread Starter
Junior Member
What's wrong with this Stored Procedure
I am getting the errors:
Msg 208, Sev 16: Invalid object name 'Archive_VTWINTABLE'. [SQLSTATE 42S02]
Msg 208, Sev 16: Invalid object name 'VTWINTABLE'. [SQLSTATE 42S02]
I checked my tables names and they match the names in the stored procedure.
CREATE PROCEDURE [p_Archive_VTWINTABLE]
AS
Declare @dateCurrentDate datetime
Declare @dblCutoffDays float
Declare @strCutOffDate varchar(11)
Declare @dateCutOffDate datetime
Select @dateCurrentDate = GetDate()
Select @dblCutOffDays = 8 * -1 -- 8 equates to the number of days to keep records in short
Select @strCutOffDate = DateAdd(d, @dblCutOffDays, @dateCurrentDate)
Select @dateCutOffDate = Convert(DateTime, @strCutOffDate)
INSERT INTO Archive_VTWINTABLE SELECT * FROM VTWINTABLE where
RecDate < @dateCutOffDate
Delete VTWINTABLE from VTWINTABLE where
RecDate < @dateCutOffDate
GO
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|