What is SQLContext?

As said previously when use ADO.NET to execute a T-SQL created stored procedure we are out of the SQL Server boundary. So we need to provide SQLConnection object to connect to the SQLServer. But when we need to execute objects which are created using .NET language we only need the context in which the objects are running.
SQLConnection and SQLContext
                                             SQLConnection and SQLContext
So you can see in the above figure SQLConnection is used because you are completely outside SQL Server database. While SQLContext is used when you are inside SQL Server database. That means that there is already a connection existing so that you can access the SQLContext. And any connections created to access SQLContext are a waste as there is already a connection opened to SQL Server.
These all things are handled by SQLContext.

0 comments:

Post a Comment

Blogger news