DECLARE @name varchar(500)
DECLARE @sql varchar(8000)
SET @sql = ''
DECLARE
Database_Cursor CURSOR READ_ONLY
FOR
SELECT Name
FROM sysdatabases
WHERE DBID > 4
OPEN
Database_Cursor
FETCH NEXT FROM
Database_Cursor INTO @name
WHILE @@FETCH_STATUS = 0
BEGIN
SET @sql = @sql + 'ALTER DATABASE [' +
@name + '] SET
AUTO_SHRINK OFF' + CHAR(10)
FETCH NEXT FROM
Database_Cursor INTO @name
END
CLOSE
Database_Cursor
DEALLOCATE
Database_Cursor
print @sql
EXEC(@sql)