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
>is it possible to use both of these commands together?
No, you cannot use both of them together
Random Solutions
Save unbound combobox column value in Access 2007
SQL 2005 Silent Install INI Path
MS ACCESS Color Picker
run-time error '-247352567 (80020009)': You can't assign a value to this object
Hi my website has a verisign certificate and it has secure payment integrated the certitifcate is expiring tomm. will i have any problem ?
Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies.
Unknown Function Name
OWA Publishing over ISA
Excel formula needed
Directory.GetFiles() returns error "illegal charactes in path". Need workaround.