| |
marconi
Posts: 8
Score: 0
Joined: 5/7/2008
Status: offline
|
Hi, I have to shrink the database on a particular server. For that 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, neither the databases on each server are shrunk nor the new output details are redirected to a log/txt file.Request you to please let me know the corrections in the script. Thanks a lot in advance. Best Regards,Marconi.
|
|