Hi,
I am creating a site on ASP and SQL, which would essentially be hosted in a
third party server like Interland or Net4India. It is dynamic in nature,
i.e. has its own database. But I have got a module in where I would need to
connect to an remote SQL server, which is located somewhere else. I know the
IP address. I would need to copy a table from that sql server to my server,
and synchronize it regularly, just in case something is updated.
Now my problem is,
(1) How do I connect to that remote sql server using ASP.
(2) Please suggest what method should i adopt to copy and synchronize the
data between the two servers.
Thank you very much,
Regards,
Bhaskardeep
Hi,
It seems you need to connect to a remote database over Internet, Am I
correct?
1. Assuming your SQL Server has a valid Internet address and sits outside
the firewall (very risky), this is easy. Just specify the server name and
address using Client Network Utility.
Server Alias: Server1
Address: 192.x.x.x or DNS
Port 1433
Note: This is using TCP/IP . I recommend looking into something like NAT for
more security.
Code will be some thing like;
Dim RMConn as ADODB.Connection
Private Sub Class_Initialize()
Set RMConn = New ADODB.Connection
With RMConn
.Provider = "SQLOLEDB"
.ConnectionString = "User ID=User;Data
Source=xxx.xxx.xxx.xxx;Initial Catalog=Database"
.Open
End With
End Sub
Have a look into the below site to setup the connection string;
http://www.connectionstrings.com/
2. Please suggest what method should i adopt to copy and synchronize the
data between the two servers
Method:1
Refer sp_addlinkedserver, sp_addlinkedserverlogin system procdures in
books online to syncronize the data.
Method:2
Incase if you need to populate 1 or 2 tables then preferably go for
1. Truncate the data
2. BCP OUT data from Remote server and BCP IN to Local server.
Thanks
Hari
MCDBA
"Bhaskardeep Khaund" <bhaskar_999@.hotmail.com> wrote in message
news:#jtMYuzHEHA.3356@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I am creating a site on ASP and SQL, which would essentially be hosted in
a
> third party server like Interland or Net4India. It is dynamic in nature,
> i.e. has its own database. But I have got a module in where I would need
to
> connect to an remote SQL server, which is located somewhere else. I know
the
> IP address. I would need to copy a table from that sql server to my
server,
> and synchronize it regularly, just in case something is updated.
> Now my problem is,
> (1) How do I connect to that remote sql server using ASP.
> (2) Please suggest what method should i adopt to copy and synchronize the
> data between the two servers.
> Thank you very much,
> Regards,
> Bhaskardeep
>
No comments:
Post a Comment