Hi,

My implementation of the Logic for checking the threshold is incorrect. I am getting Syntax Errors. Could you please provide your inputs.

Also could you please provide your inputs for shrinking the database wherein I am creating a .cmd file with the following code :-
--------------------------------------------------------------------------------------------------------
sqlcmd -s -Q ľo switch "EXEC sp_MSForEachDB @Command1 = N'DBCC
SHRINKDATABASE (jobserver1, 10)', @replacechar = 'jobserver1'" -c go



sqlcmd -s -Q ľo switch "EXEC sp_MSForEachDB @Command1 = N'DBCC
SHRINKDATABASE (jobserver2, 10)', @replacechar = 'jobserver2'" -c go



sqlcmd -s -Q ľo switch "EXEC sp_MSForEachDB @Command1 = N'DBCC
SHRINKDATABASE (jobserver3, 10)', @replacechar = 'jobserver2'" -c go



sqlcmd -s -Q ľo switch "EXEC sp_MSForEachDB @Command1 = N'DBCC
SHRINKDATABASE (databaseserver, 10)', @replacechar = 'databaseserver'" -c go

--------------------------------------------------------------------------------------------------------

When this CMD File is run, the databases on each server need to be shrunk and the new output details will be redirected to a log/txt file.

Thanks and Regards,
Marconi.