Solved

SQL Server instance port connection string

Posted on 2007-11-27
7
3,394 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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 500 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 142

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now