|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Setting up the SQL Server alias programaticallyIn our corporate environment, the data services group, for some reason,
does not run SQL Server using it's default ports, they always change. For my application, I have to install the SQL client tools on the machine where the app will be run and then set up an alias to that port. Can this be done programatically or with a change to the connection string without having to install the SQL client tools? Is there a registry setting to be added? We are using SQL authentication. Thanks Chris Chris Dunaway wrote:
> In our corporate environment, the data services group, for some reason, Isn't that always the way? As soon as you post the question, you find> does not run SQL Server using it's default ports, they always change. > For my application, I have to install the SQL client tools on the > machine where the app will be run and then set up an alias to that > port. > > Can this be done programatically or with a change to the connection > string without having to install the SQL client tools? Is there a > registry setting to be added? > the answer. For the benefit of others, here is the answer. Just add an entry to the following registry key: HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo While this seems to work, I would much rather have a programatic solution that did not involve directly editing the registry. Thanks again <DIV>"Chris Dunaway" <dunaw***@gmail.com> wrote in message
news:1158078153.082920.14790@e63g2000cwd.googlegroups.com...</DIV>> In our corporate environment, the data services group, for some reason,> does not run SQL Server using it's default ports, they always change. 1) If the SQL Server runs the SQL Browser Service, your clients should be > For my application, I have to install the SQL client tools on the > machine where the app will be run and then set up an alias to that > port. > > Can this be done programatically or with a change to the connection > string without having to install the SQL client tools? Is there a > registry setting to be added? > > We are using SQL authentication. > able to connect without knowing the port. 2) You should be able to configure the application to specify the port, instead of having to use a client alias. David David Browne wrote:
> 2) You should be able to configure the application to specify the port, Thanks David,> instead of having to use a client alias. After a little more research, I was able to use this connection string without adding any entries to the registry: server=server,12345;Network Library=DBMSSOCN;database=dbname;User Id=user;Password=password; BTW: I'm using C# 2.0, Enterprise Library January 2006
Return a City in a column on max count from another column in a group by
SQL statement increase question Help me performance optimize Strange result Need help with select statement Dynamic SQL load into dynamic table SQL Select using parameter Two instances of sql on one server causes problems timeout expired The opposite to DECLARE.. |
|||||||||||||||||||||||