Site Server - How to read sql server connection from other machine
Asked By bhanupratap singh on 28-Apr-15 01:16 PM
I have an issue, that I have deploy my web application with Sql server 2008 database on pc-1. Now there is a table EmployeeAttendance which lying in another pc-2 databse sql server 2008. I want to read EmployeeAttendance table from pc-1 sql server.
So that I could use
How to do it ?
Robbe Morris replied to bhanupratap singh on 28-Apr-15 01:20 PM
You have to adjust the properties of both SQL Server instances to accept remote connectivity (Sql Server Management Studio - Connection Properties).
You then need to configure them as linked servers using the sp_addlinkedserver command.
The query syntax is
select * from serverName.dbo.tableName where blah blah blah
Honestly, you are better off creating web handlers in your web app to accept remote requests for data. It is far more secure and hassle free then trying to set up sql server remote connectivity between desktop versions of sql server. In fact, I'm sure the local free version of sql server even supports this. If you are using Standard Edition on each PC, you'd need a license for each. That's expensive...