This command will rebuild the index on the database you select in the query window

Exec sp_MSforeachtable “Print ‘?’ DBCC DBREINDEX (‘?’)”

Go

*Edit: the above command is depreciated. I found a post mentioning to use ALTER INDEX instead. I don’t know the syntax yet but here is the post:

SQL SERVER – Stop Using DBCC DBREINDEX and Use ALTER INDEX

Command to view the current status of a command executing:

select * from sys.sysprocesses where spid = 56 (the number 56 is an example. You want to put the number of the script you want to view and can be found in parenthesis (56))