Using Stored Procedures and functions from SQLServer


how can i use some stored procedures and some sql functions that i´ve made in my sqlserver database.

The outsystems plataform integrates SQLserver tables and views as foreing entity... but how does it work for stored procedures and functions that accepts parameters!?

I presume that "create view" doesn't solve my problems...

Miguel Coutinho
Hi :)

You can use sql procedures and other functions directly in an Advanced Query .

Just insert the code in the advanced query editor. Sometimes the parser will tell you that you have an error when you do validate expression but you can ignore that.


I've tried to use adv query and everything went OK for sql user defined functions.

Wright now I'm using a stored procedure in an advQuery to access some information.

In SQLquery analiser the SP is working fine and even through linked servers.

I'm using this query :
"Exec dbo.daprecomultiMobile @Cbarr ,@LstPrecos ,@Estacao "

I'm getting this error msg:
"Server was unable to process request. --> Error in advanced query QRY_getpreco in getPreco in SLS_Central (exec dbo.daprecomultiMobile @Cbarr ,@LstPrecos ,@Estacao ): Access to the remote server is denied because no login-mapping exists."

I've tried every thing... :(
Hi Miguel,
it looks like the user that the platform is using to execute the query is unable to login to the remote server that the stored procedure is trying to access.

Have you tried running the stored procedure with Query Analyzer but logged in with the Runtime user that's configured in the Hub Server Configuration Tool?

When you log in to Query Analyzer you have a choice of using Windows authentication or an SQL Server login and password. You don't say which one you used in your post, but I'm guessing you logged with Windows authentication, or with the 'sa' user and that that enabled SQL Server to map the user to a user the remote SQL Server would recognize. You may have to configure the linked server in your local SQL Server to map the Runtime user you've created to a specific Windows or remote user that the remote server can accept.

Best regards,
Marco Cunha