USE NAGEBOARD
GO
IF EXISTS(SELECT name from sysobjects WHERE name='crttable' AND type='p')
DROP PROCEDURE crttable
GO
USE NAGEBOARD
GO
CREATE proc crttable
as
declare @nalja varchar(10)
declare @nalja1 varchar(10)
set @nalja= convert(varchar(30), getdate(),12)
set @nalja1= convert(varchar(30), getdate()-1,12)
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[itemtrade'+@nalja+']') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
begin
return
end
else
begin
exec crttable_trade
end
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[itemtrade'+@nalja1 +']') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
begin
exec deltable_item1
end
评论