Executing Store Procedure in SQL


I am executing store procedure with following syntax and it is working fine :

Exec [MyDBName].dbo.[MyStoredProcedure]


Here [MyDBName] is the database name. and it is in development environment.

On testing environment i have a database name for eg. [MyDBNameTesting], in this case after deploying my application on the Testing environment I have to manually open my Testing Application in the Service Studio and i have to change the syntax manually as below:

Exec [MyDBNameTesing].dbo.[MyStoredProcedure]


And this is also working fine. 

But I do not want to change this manually, for this I created a Database Connections in both environment with same name. So in place of database name I want to use Database Connections name to avoid changing database name manually.

But I do not find the way how to execute store procedure with database connection name instead of database name.

Please help me to achieve this.



Hello Alam, you can't execute an advanced query through database connection like that way. 

Normally database connection is unused to map other "Entities" using a Integration Service and just when you are fetching these entities Outsystems change connection to connection registered in service center (database connection).
I suggest you use this extension. It allow you set up witch connection you want to use and execute the command by that connection. 


I created this extension thinking in some of cases like that. I would like to say that a new release is coming with new features.

Hope it be useful.

Best Regards,
Paulo Fagundes