Microsoft
Software
Hardware
Network
Question : sql
I am attempting to write a query that will loop through all the databases and rebuild all the indexes for each table.
I would like to use sp_msforeachtable and msp_msforeachdb
[code]
EXEC master..sp_MSForeachdb '
USE [?]
BEGIN
declare @starttime datetime
set @starttime = getdate()
print ''?''
EXEC sp_MSforeachtable @command1="DBCC DBREINDEX (''?'')"
declare @endtime datetime
SELECT @endtime = GETDATE()
INSERT INTO DBADB..MaintPlans values (getdate(), ''indexes'',db_name(), datediff(minute,@StartTime
, @EndTime))
END'
GO
[/code]
and i am receiving an error. is it possible to use both of these commands together? Also, i would like to include the fillfactor = 90% (DBCC REINDEX ( tablename, '', 90)
Any assistance you could provide would be great.
Answer : sql
Yahoo!Mail is based on it and some hosting company too :
http://www.zimbra.com/part
ners/zimbr
a_hosting.
html
Note you've multiple edition with different support service)
http://www.zimbra.com/prod
ucts/produ
ct_edition
s.html
Random Solutions
Login failed for user 'TestDomain\testuser'. The user is not associated with a trusted SQL Server connection.
How to use "IsNull" with varchar datatype?
ASP.NET AJAX PasswordStrength Extender problem in Wizard Control
Simple SQL Join Query Syntax Issue
Input Boxes
My asp.net button is still not enabled even when I set it to enabled
Why is the system popping up after reboot with .NET Framework 2.0 required after Vista SP 64 to Win 7 64 upgrade?
New issue with report run counter not incrementing by 1
Will Not See Hard Drive
The most effective way to communicate on the web in real time.