|
-
Jan 23rd, 2022, 05:21 AM
#1
Thread Starter
Member
Very Slow SQL Query When Using IP in Connection String
Hello,
I am having a real big headache with slow SQL query.
I have two connection string which are as follows :
ConnectString1 = "Driver={SQL Server};Server=MSSQLSERVER5;Database=SchoolMain;Uid=Admin;Pwd=admin101;"
and
ConnectString2 = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=Admin;Password=admin101;Initial Catalog=SchoolMain;Data Source=192.168.1.2,1433"
Both are connecting to a SQL Database Instance on the same System. The first connects using the Database Instance Name, while second connects using IP Address (Over the Internet on the system) and Port Number.
Query with ConnectString1 is very first, takes less than 2 seconds to execute while Query with ConnectString2 is extremely very slow and most times comes back with Query Time Out Expired.
I have searched everywhere on the internet and still cannot find where the issue is. I read about turning off the LLMNR protocol and adding entries in the hosts file to tackle Reverse DNS, followed the steps but its still same as Query with ConnectString2 is still very slow.
Though when i changed the IP Address in ConnectString2 from 192.168.1.2 to 127.0.0.1, Query works very fast, just exactly as it is with ConnectString1. Is there a way to route all IP address to 127.0.0.1 on the machine ?
I need ConnectString2 to work Query will be pushed over the IP address from other systems outside the LAN.
Note : I am using SQL Server 2008
Please help.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|