Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2008-12-31 : 10:29:00
|
1)i want to write code that will go over all the tables, in each table will go over each of the index's and change it to 100%.2) if i have a table that i dont change anymore but i do query it do i need to or will it affect the query's if i will mark the "fill pad" of the index's. (if not then how do i add it to the code in (1))Thanks in advanceand happy new yearPelegIsrael -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-12-31 : 10:38:09
|
sp_msforeachtable 'DBCC DBREINDEX(''?'', '''', 100)' E 12°55'05.63"N 56°04'39.26" |
|
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2008-12-31 : 10:59:42
|
and what if i want to do it on specific tables?Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-12-31 : 13:09:47
|
Fill a staging tables with all the table names and/or index names and make a cursor or similar to handle all entries. E 12°55'05.63"N 56°04'39.26" |
|
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2009-01-01 : 05:37:37
|
ok how do i get the list of index's of a certin table?Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-01-01 : 07:40:08
|
You can use like this:Exec sp_MSforeachtable @command1 = Operation,@whereand = "and o.name Like 'tablechoice%'" |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-01-01 : 07:47:02
|
quote: Originally posted by pelegk2 ok how do i get the list of index's of a certin table?Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
sp_helpindex 'tablename' |
|
|
|
|
|