DEV Community

Discussion on: Setting up a Laravel project with SQL Server AND XAMPP / WAMP on Windows

Collapse
 
rjalvarez profile image
Rafael Alvarez

729/5000
Hello, nice to greet you, I have a system made in Laravel 6 (migrated from Laravel 4) and MySQL but I must also connect it with SQL Server, there I only have to use a stored procedure to store some records in another system, as I should make the call from the controller? I have used the following but all give error
DB :: connection ('sqlsrv') -> SELECT ('SET NOCOUNT ON; CALL SP_APIRserve Service2?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ? ', $ arrangement);
and
DB :: connection ('sqlsrv') -> insert ('SET NOCOUNT ON; EXECUTE SP_APIRserve Service2?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ? ', $ arrangement);
and
DB :: connection ('sqlsrv') -> insert ('EXECUTE SP_APIRserveService2?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?', $ arrangement);
my email rjalvarez85@gmail.com

Collapse
 
mr_steelze profile image
Odunayo Ogungbure

I think what you have to do is

DB::connection()->statement()