2
Posted on 6:04 AM by Softminer and filed under
SQL
DECLARE @DBName varchar(255) DECLARE @LogName varchar(255) DECLARE @DATABASES_Fetch int DECLARE DATABASES_CURSOR CURSOR FOR select distinct name, db_name(s_mf.database_id) dbName from sys.master_files s_mf where s_mf.state = 0 and -- ONLINE has_dbaccess(db_name(s_mf.database_id)) = 1 -- Only look at databases to which we have access and db_name(s_mf.database_id) not in ('Master','tempdb','model') and db_name(s_mf.database_id) not like 'MSDB%' and db_name(s_mf.database_id) not like 'Report%' and type=1 order by db_name(s_mf.database_id) OPEN DATABASES_CURSOR FETCH NEXT FROM DATABASES_CURSOR INTO @LogName, @DBName WHILE @@FETCH_STATUS = 0 BEGIN exec ('USE [' + @DBName + '] ; DBCC SHRINKFILE (N''' + @LogName + ''' , 0, TRUNCATEONLY)') FETCH NEXT FROM DATABASES_CURSOR INTO @LogName, @DBName END CLOSE DATABASES_CURSOR DEALLOCATE DATABASES_CURSOR
Pune Escorts
Escorts In Pune
Escort Service In Pune
Independent Pune Escorts
Female Pune Escorts
Call Girls in Pune
Female Escort in Pune
Pune Escorts Girls
Escort Pune
Pune Escort Services
Best Pune Escorts
VIP Pune Escorts
Celebrity Pune Escorts
Model Escorts in Pune
Russian Escort in Pune
High Profile Pune Escorts
Escorts in Jaipur
Escorts in Nashik
Jaipur Escorts
Nashik Escorts
Escort Service in Jaipur
Escort Service in Nashik
Python proxy interview support from India
ReactJs proxy interview support from India
MicroStrategy proxy interview support from India
Dot Net proxy interview support from India
DevOps proxy interview support from India
Python online job support from India
ReactJs online job support from India
MicroStrategy online job support from India
Dot Net online job support from India
DevOps online job support from India
Post a Comment