Back
Theme:

Execute StoreProcedure remote


How can I execute stored procedure remote?

Date: Friday, August 4, 2023
2 answers | 132 view(s)
by Mauricio Junior

Answers

You can prepare your command with parameters and execute using exec sp_execute_remote with the database name.

declare @SqlCommand nvarchar(max) = N'PROC_NAME @PARAMETER = ''' + @VALUES + ''''
exec sp_execute_remote N'InternalConnectionName', @SqlCommand

It's necessary to use the internal connection name because in this case my database is connected with another database.

Friday, August 4, 2023

Mauricio Junior


It is faster than run using another way by my experience.

Friday, August 4, 2023

Mauricio Junior


Curso de Microsoft Excel