0

I got 2 instances (SQL Server 2012 and 2014) installed in my PC, and they both have different port numbers. I am having issues connecting to the second one.

A bit more in detail:

SQL Server 2012:

  • Name -> AUG001
  • Port no. -> 1221

SQL Server 2014:

  • Name -> AUG001\Cardiff
  • Port no. -> 1331

I am able to connect to the first one (SQL Server 2012) remotely and select the databases while installing the app.

But I can't get the second one to display the databases in it.

The connection string would be something like this for SQL Server 2012 and it works:

Provider=SQLOLEDB;Server=AUG001;Database=Catalog;UID=sa;PWD=london;Persist Security Info=True

But when I have a connection string as shown below for SQL Server 2014, it doesn't work:

Provider=SQLOLEDB;Server=AUG001\Cardiff,<1331>;Database=Catalog;UID=sa;PWD=london;Persist Security Info=True

It doesn't display any rows from the catalog and I get the error, connection string is invalid

Any ideas please anyone?

Oasis001
  • 79
  • 2
  • 17
  • Try Server=AUG001\Cardiff:1331 instead of the <1331> you've got now. – simon at rcl Dec 04 '18 at 16:40
  • Nope, it doesn't work. Same error-> Connection string invalid, parameter incorrect – Oasis001 Dec 04 '18 at 16:52
  • Have you noticed that you have the <> around the 1331? – Richardissimo Dec 04 '18 at 17:32
  • 1
    Possible duplicate of [How to specify a port number in SQL Server connection string?](https://stackoverflow.com/questions/5294721/how-to-specify-a-port-number-in-sql-server-connection-string) – Richardissimo Dec 04 '18 at 17:34
  • Sorry, that was a typo from edit I think. Corrected it now. – Oasis001 Dec 04 '18 at 17:34
  • Go read Richard's link first - your port number is not correctly formatted. Generally you don't need to use port numbers if the sql server browser service is running. You also refer to "the app". So - can you access the second one using ssms, bcp, sqlcmd, or any other tool besides "the app"? – SMor Dec 04 '18 at 18:11
  • Try Server=AUG001\Cardiff:1331 – donPablo Dec 04 '18 at 21:48

0 Answers0