Mar 20, 2008

MimeSweeper sql script

select name from sysdatabases where dbid > 6
go

sp_changedbowner 'sa'
go
sp_changeobjectowner 'Archive.MAILINFO','dbo'
go
sp_changeobjectowner 'Archive.MAILTO','dbo'
go
sp_dropuser 'Archive'
go
sp_changedbowner 'Archive'


CREATE VIEW MAILINFO as
select * from archive20080310..MAILINFO
union all
select * from Archive20080229..MAILINFO
union all
select * from Archive20080218..MAILINFO
union all
select * from Archive20080130..MAILINFO
union all
select * from Archive20080117..MAILINFO
union all
select * from Archive20080116..MAILINFO
union all
select * from Archive20071221..MAILINFO
union all
select * from Archive20071212..MAILINFO
union all
select * from Archive20071205..MAILINFO
union all
select * from Archive20071122..MAILINFO
union all
select * from archive20071113..MAILINFO
union all
select * from archive20071101..MAILINFO
union all
select * from archive20071101..MAILINFO
union all
select * from archive20071024..MAILINFO
union all
select * from archive20071012..MAILINFO
union all
select * from archive20070927..MAILINFO
union all
select * from Archive20070912..MAILINFO
union all
select * from archive20070901..MAILINFO
union all
select * from archive20070831..MAILINFO
union all
select * from archive20070802..MAILINFO
union all
select * from archive20070718..MAILINFO
union all
select * from archive20070627..MAILINFO
GO


CREATE VIEW MAILTO as
select * from archive20080310..MAILTO
union all
select * from Archive20080229..MAILTO
union all
select * from Archive20080218..MAILTO
union all
select * from Archive20080130..MAILTO
union all
select * from Archive20080117..MAILTO
union all
select * from Archive20080116..MAILTO
union all
select * from Archive20071221..MAILTO
union all
select * from Archive20071212..MAILTO
union all
select * from Archive20071205..MAILTO
union all
select * from Archive20071122..MAILTO
union all
select * from archive20071113..MAILTO
union all
select * from archive20071101..MAILTO
union all
select * from archive20071101..MAILTO
union all
select * from archive20071024..MAILTO
union all
select * from archive20071012..MAILTO
union all
select * from archive20070927..MAILTO
union all
select * from Archive20070912..MAILTO
union all
select * from archive20070901..MAILTO
union all
select * from archive20070831..MAILTO
union all
select * from archive20070802..MAILTO
union all
select * from archive20070718..MAILTO
union all
select * from archive20070627..MAILTO

0 意見: