function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mromanimromani 

Accessing SQL

I was wondering, is there a way to be able to access SQL from Apex or even VisualForce...

We'd like to retrieve some data from our SQL Server 2008 from a controller (in Apex), and seem to be stuck, not sure how to proceed or if it is even possible.

 

Any suggestion or help would be greatly appreciated!

 

Thanks

 

mromani

Best Answer chosen by Admin (Salesforce Developers) 
gm_sfdc_powerdegm_sfdc_powerde
It's not possible to directly connect to external data sources from Apex or Visualforce.  However, you can make SOAP-based web service callouts or plain HTTP callouts from Apex. If you can create an external application to deal with the data source and have it publish a SOAP-based or plain HTTP service, you can access the service from Apex to achieve what you are looking for.