How to use a 4-part naming convention to invoke a linked server as part of setting update statistics?

I install a job on the integration server to run a statistical update in my client database.

The problem is that the syntax of the update statistics does not allow me to give a name in 4 parts.

I would like to do something like this:

UPDATE STATISTICS [linked server].[database].[dbo].[table] 

WITH FULLSCAN

GO

But I get a message that the maximum number of prefixes has been exceeded.

Does anyone know how to get around this? I really have no way to host this locally in my client database.

ANSWER TO FIND

Thanks to everyone who threw hats at this, but I really found a really cool workaround for this and hopefully it can help someone else.

EXEC [linked_server].[database].[sys].[sp_executesql] N'UPDATE STATISTICS [dbo].[table] WITH FULLSCAN'

, SQL, .

, , , .

+4
1

, , ;-). . SSIS. SSIS UPDATE STATISTICS / .

, SSIS, :

0

All Articles