.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

SQL Server (2005 to latest) - Change dynamic port to static TCP port 1433 automatically

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :

Hello All !

By default, when I install SQL Server (from 2005 to the lastest), the TCP port 1433 is not set to 1433 on the network interfaces (see with SQL Server Configuration manager - Network Connections - TCP/IP enable - properties - IPAll).

Many of applications use this 1433 port. I want to change this port automatically, after installation and disable dynamic ports

How can I do this with a powershell script ? or by Transact-SQL ?


Thanks for advance for your ideas / help - Regards - Have a nice day ! RHUM2

View Complete Post

More Related Resource Links

Change Port No

I have some API and repactha control in my web application which communicate from port no 80.I am using shared hosting provided by Reseller Club and they have blocked port no 80 for outgoing communication. They asked me to send request from port no 53,25,1433How can i do that?

How to setup port forwarding for SharePoint server on home network

I have a SharePoint 2010 server running on my home network.  I want to be able to access the server from the internet and edit pages, create sites etc.  The web applications is running on a specific port (1234) not port 80. I've configured my router to forward port 1234 to the server's IP address and I can access the site fine from the internet using the routers IP address and adding the port number.  Viewing the site works fine but the problem is when I try to access a page in the _layouts folder for any of the sub sites I get a "File not found" error.  Also, if I go to a sub site and create a new site (no _layouts page required) it works but the new site is created directly under the root and not the sub site. It seems that the port forwarding from the router is messing up the context for the _layouts folder.  Is there any way around this? Thanks.

Visual studio 2005 - Port Number is difference during run time.

Hi, When I debug(F5), the port number display in the URL is difference from the ASP.net development server. Eg: URL address port number is  - 1084, while for the Server is 1088 I have tried difference ways such as trying to set the dynamic port to false, so that I can configure my own port, but it is not able to work. I have also turned off the ESet Firewall however the port number is still difference.  Need your help in this area.. Thank you! 

Why do I have to specify port 1433 on my connection string?


Hi All,

I have a Windows 2003 Std R2 with one instance (default) SQL2000 STD and another instance (secondary) with SQL2005 STD, both instances using port 1433, firewall already configured.

I'm using the following string connection to access my server with ADO.NET 2.0:

server=mer02\dpm,1433;initial catalog=dpm;TrustServerCertificate=yes;Encrypt=yes;Connection Timeout=30;User=*******;Password=********

Well, I don't know why, but I have to specify port 1433, otherwise I'm not able to connect, I have tried to telnet to mer02 port 1433 and it answers OK, even if I use Sql Management Studio from a local pc I have to access with mer02\dpm,1433 otherwise it takes sometime to return that the server may no be configured to accept remote connections.

Any ideas ?

Thanks in advance




dynamic hyperlink with port specification


i am trying to insert a dynamic hyperlink with port specification

for example

normally its easy

<a href="../home/orangehrm">HRMS</a>

but if i have to include the port specification (port 3002) as below

<a href=":3002/home/orangehrm">HRMS</a>

this isnt working so isnt the right format

please help

port sql 2000 to sql 2005


Need url on good kb or article on converting sql 2000 to sql 2005 (full version not express)


Michael Oard

How to connect a remote Sqlserver 2008 r2 server with IP address and port? I use SMO and VS2010.


how to write SMO's conn.ConnectionString with IP address and port?

Error while accessing the Sharepoint Foundation http://sharepoint server:port/_vti_bin/lists.asmx



Error while accessing the Sharepoint Foundation http://sharepoint server:port/_vti_bin/lists.asmx. we got below error. please help us to sort this below error.

The top XML element 'string' from namespace 'http://schemas.microsoft.com/sharepoint/soap/' references distinct types Microsoft.SharePoint.SoapServer.SoapXml.SoapXmlElement and System.String. Use XML attributes to specify another XML name or namespace for the element or types.


Troubleshoot issues with Microsoft SharePoint Foundation.

Correlation ID: fe7f8707-44db-4744-8a78-337a5e8a80de

Date and Time: 10/25/2010 10:32:28 AM

Thanks & Regards,



Changing the SQL Port of a Clustered SQL Server 2008 in Win Server 2008R2



The above setup is in vmware. The 2-node cluster works fine. Able to failover to and fro.  Just that when I tried to change the port 1433 to 12345, the cluster is not able to online the SQL Service. Below is the application error log:

[sqsrvres] checkODBCConnectError: sqlstate = 08001; native error = 274d; message = [Microsoft][SQL Server Native Client 10.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.

The service status becomes Pending Online and after a while, it becomes offline. Using the SQL Configuration Manager, I revert to 1433 and it works fine again. May I know what am I missing ?





C#, sockets, Windows and port 21 : A simple Client-server using TCP; connection dies after transfer



I have a thread on Stackoverflow here:


In short: 

In a very VERY simple Client-Server solution the TCP connection dies after sending 65535 bytes. This only happens when I am connected on port 21. If I change the server port to for example port 22 the connection does not die.

I am posting the simple code here for reference.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Threading;
using System.Net.Sockets;

namespace tWorks.Samcom.PassSocketPoller
  public class PollerTest2
    private IPAddress _sutiSocketIpAddr;
    private int _sutiSocketPort;

    private Thread pollerThread = null

How fast can you change baud rate on a serial port.


Hello to anybody,

I've got a piece of hardware I wan't to communicate with over a serial port and I'm wanting to change baud rate on a serial port within 10 ms.  I close the port, change baud rate and then open the port agian, but this doesn't seem to work to well.  How can I really tell if the serial port has made the change, how long is this likely to take? Is changing the baud rate in 10 ms impossible?

Any answers would be appreisated, thanks.

Remote access to SSAS (SQL Server 2008): problems with SQL Browser / UDP port 1434


Hello everyone,

since last Friday I'm fighting with an issue, which drives me crazy. I tried all the hints I found, but nothing worked. Now I address the community with a hope, that anyone can help me.

So, here is my situation: I have dedicated database server (server'S OS is Windows Server 2008, DBs are (1) SQL Server 2008 SE with all BI components, named instance and (2) SQL Server Express Edition, installed together with VS 2008), joined to our company's domain. My laptop is also in this domain. When I try to connect to the named instance of SSAS on that server from my laptop using SSMS or BIDS, connection fails. When I connect to SSAS on the server itself, it works.

What I did on Friday:

1) I opened all "SQL-server"-related ports in the server's firewall (including UDP port 1434 and TCP port 2382);

2) I tested UDP port with telnet (telnet <IP-address of the host> 1434) - ne response, neither localy nor remote;

3) portqry2 gives following output:
C:\PortQryV2>PortQry.exe -n <IP-address> -p UDP -e 1434

Querying target system called:

Attempting to resolve IP address to a name...

Failed to resolve IP address to name


UDP port 1434 (ms-sql-m service): LISTENING or FILTERED

Sending SQL Server q

Setting static port for SSAS 2008 R2



In my experience I don't meet the requirement to set a static port for the Analysis Services. Working with the 2005 version, I think that it is possible set the static port from the properties of Analsysis Server in the Management Studio. How do I do this operation in SSAS 2008 R2, please? Does it exist any documentation about this subject?

Many thanks

need to get value of Port ,Database Name and Database Server while creating "Create New Web Applica



1> i need to get the value of PORT ,Database Name  and Database Server while creating "Create    New Web Application" using Central Admin under "Application Management "  on "OK" button.

2> how to get these value on OK button click, i need to retrive these value and wirte it into text file.

3> Any other idea to get these filed value ?


thanks in advance



SQL Server 2005 Try and Catch Exception Handling

I'm pretty excited to see that there is some real error handling for T-SQL code in SQL Server 2005. It's pretty painful to have your wonderfully architected .NET solution tainted by less-than-VBScript error handling for stored procedures in the database. The big difference being the addition of TRY..CATCH blocks. Let's take a look:

bluetooth print via serial port PDA

Print via BlueTooth using PDA

Parallel port complete: programming, interfacing & using the PC's parallel

Parallel port complete: programming, interfacing & using the PC's parallel

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend