DEFINITIONS

Definitions More Info.
Definition ID293
TitleSQL
CategorySCRIPT
DefinitionSEMADA YAPILAN DEGISIKLERI LOGLAYAN SORGUYU DROP ETME
Definition Description/*BURADA DATABASELERDE TABLO VE TRIGGERLARI OLUSTURUR*/ declare @dbname varchar(80) DECLARE @CommandToExecute varchar(8000) --DATABASE ID NUMARASINI KONTROL ET!!BAZEN SYSTEM DATABASE NUMARALI 4-5 DEN KUCUK OLABILIYOR Declare DBName_cur Cursor FAST_FORWARD FOR select name from sys.databases where name not in('tempdb', 'master', 'model', 'msdb', 'ReportServer', 'ReportServerTempDB', 'distribution', 'CHECKDB') and is_read_only=0 order by name Open DBName_cur; FETCH NEXT FROM DBName_cur INTO @dbname WHILE @@FETCH_STATUS = 0 BEGIN set @CommandToExecute='USE '+'['+@dbname+']'+' IF EXISTS (SELECT * FROM sys.triggers WHERE name=''backup_objects'') begin drop trigger backup_objects on database end ' --exec (@CommandToExecute) print(@CommandToExecute) FETCH NEXT FROM DBName_cur INTO @dbname END CLOSE DBName_cur; DEALLOCATE DBName_cur;
RecordBycunay
Record Date16-01-2013 14:59:46
Düzenle
Kopyala
Sil