patternsqlMinor
Reindexing / rebuild Indexes on Linked Server tables
Viewed 0 times
tablesreindexingindexesrebuildserverlinked
Problem
I am trying to run the below query to rebuild the index on a table on the Linked server, but it is not working. Can any one please let me know what I am doing wrong?
This is giving me below error:
Cannot find the object "[LinkedServerName].[dbname].[dbo].[tablename]" because it does not exist or you do not have permissions.
ALTER INDEX ALL ON [LinkedServerName].[dbname].[dbo].[tablename] REBUILD
WITH (FILLFACTOR = 90)This is giving me below error:
Cannot find the object "[LinkedServerName].[dbname].[dbo].[tablename]" because it does not exist or you do not have permissions.
Solution
Four-part-naming syntax is not supported for
Try this:
ALTER INDEX.Try this:
EXEC ('ALTER INDEX ALL ON [dbname].[dbo].[tablename] REBUILD WITH (FILLFACTOR = 90);')
AT LinkedServerName;Code Snippets
EXEC ('ALTER INDEX ALL ON [dbname].[dbo].[tablename] REBUILD WITH (FILLFACTOR = 90);')
AT LinkedServerName;Context
StackExchange Database Administrators Q#159354, answer score: 7
Revisions (0)
No revisions yet.