|
Definitions More Info. | Definition ID | 91 | Title | SQL | Category | SCRIPT | Definition | MAIL_ATMA_DEGISKEN_BODY_ILE | Definition Description | DECLARE @strSQL VARCHAR(8000) set @strSQL='SELECT name FROM sys.tables WHERE name like ''VPOSBatchEncashQueue_Archive_2%'' AND create_date <= DATEADD(DAY,-1,GETDATE()) --job çalışma zamanından 24 saat önce oluşturulan tablolar arşivlenir. ORDER BY create_date' create table #tmp_VPOSBatchEncashQueue_Archive (hede varchar(50)) insert into #tmp_VPOSBatchEncashQueue_Archive exec(@strSQL) declare @hede varchar(50) select @hede=hede from #tmp_VPOSBatchEncashQueue_Archive EXEC msdb.dbo.sp_send_dbmail @recipients='[email protected]', --@recipients='[email protected]', @subject = '213.243.39.200 DATABASE KOTA UYARISI !!!', @body = @hede, @body_format = 'HTML'; ------------------------------------------------------------------- veya DECLARE @TodayDate as varchar(40), @TodayHour as varchar(40), @TodayMinu as varchar(40), @NewFileName as varchar(100), @cmdstr as varchar(128) SELECT @TodayDate = CONVERT(varchar(10), GETDATE(), 112) SELECT @TodayHour = DATEPART(hh,GETDATE()) SELECT @TodayMinu = DATEPART(minute,GETDATE()) SELECT @NewFileName = 'DOGANTELEKOM'+'_'+'ABONE'+'_'+@TodayDate + '' + '.abn' print @NewFileName set @cmdstr='COPY /Y D:\TIBTOTAL\TIB.txt D:\TIBTOTAL\TIB_FARK_ARSIV\'+@NewFileName EXEC master..xp_cmdshell @cmdstr --query sonucunu mail atan bölüm EXEC msdb.dbo.sp_send_dbmail @recipients='[email protected];[email protected]', --@recipients='[email protected]', @subject = 'TIB DOSYASI OLUSTURULDU', @body = @NewFileName, @body_format = 'HTML'; | RecordBy | cunay | Record Date | 20-02-2012 16:39:30 | Düzenle | | Kopyala | | Sil | | |
|
|