[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SQL Server instance port connection string

Posted on 2007-11-27
7
Medium Priority
?
3,406 Views
Last Modified: 2008-02-01
What's the format that server, instance, and port have to appear in a sql server connection string?

Thanks
0
Comment
Question by:gromul
  • 4
  • 2
7 Comments
 
LVL 25

Expert Comment

by:imitchie
ID: 20362386
Provider=SQLOLEDB.1;Password=xxxx;Persist Security Info=True;User ID=xxxxx;Initial Catalog=mydbname;Data Source=servername\instance
0
 
LVL 25

Expert Comment

by:imitchie
ID: 20362393
If you want to connect on a non-standard port, you'll have to do that by creating a SQL alias in SQL Server Client Network Utility (Start->Run->CliConfg.exe),
and setting the port number there
0
 

Author Comment

by:gromul
ID: 20362427
Could I do something like this?

DataSource=servername\instance,port
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 25

Expert Comment

by:imitchie
ID: 20362555
what application or IDE are you using?
0
 

Author Comment

by:gromul
ID: 20362782
I want to set up a connection string from C# code.
0
 
LVL 25

Accepted Solution

by:
imitchie earned 2000 total points
ID: 20362803
then yup, DataSource=servername\instance,port is right

Provider=SQLOLEDB.1;Password=xxxx;Persist Security Info=True;User ID=xxxxx;Initial Catalog=mydbname;Data Source=servername\instance,port;
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20363503
note: unless your sql server has been changed to use the non-default port, you can leave the port information out of the connection string.
only in an environment where the sql server port has been changed for security it must be specified...
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question