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
Automatically close Outlook on log off or shutdown
Icons from Start>All Programs have disappeared
Finding Null in a memo field and what event to use to check the related box
Outlook problem with error 0x80040154 (and others) -- inetcomm issue?
Sql query
Using regsvr32 in Vista via batch file
ORA-12514 TNS:listener does not currently know of service requested in connect (yet agian?)
SQL - Trim letters out of a field where the length is unknown
To Virtualize or not
Response.Redirect is not working properly in the server?