TartanTaurus
asked on
How to call a stored procedure from a function
Hi,
I'd like to know how / correct syntax I should be using to call a stored procedure in SQL Server from a script function in JavaScript.
The environment I'm working in is Sage CRM however the answer to this question does not appear to need to be specific to any particular software.
Thanks
I'd like to know how / correct syntax I should be using to call a stored procedure in SQL Server from a script function in JavaScript.
The environment I'm working in is Sage CRM however the answer to this question does not appear to need to be specific to any particular software.
Thanks
ASKER
Thanks for that,
I have my connection as follows, but when I try to call it, I get an error saying it cannot find stored proc by that name. Any suggestions?
Thanks
I have my connection as follows, but when I try to call it, I get an error saying it cannot find stored proc by that name. Any suggestions?
Thanks
function UpdateRecord()
{
var connection = new ActiveXObject("ADODB.Connection");
connection.Open("Data Source=localhost\\TabletProject,1433;Provider=SQLOLEDB;User Id=sa;Password=xxxxx;Persist Security Info=True;Initial Catalogue=G41;");
var r = connection.Execute("exec customrefproc");
oppo_customref = r;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
See EE Issue
https://www.experts-exchange.com/questions/23444588/Calling-SQL-Stored-Procedure-from-Javascript.html