Showing posts with label port. Show all posts
Showing posts with label port. Show all posts

Thursday, March 22, 2012

Change default port no.

Hi,
As we know,SQL server listens on port 1433 by default. Is there any
dependency between client and SQL server for this port number?I mean, how
will know the client that on which port the target SQL server listens?
Suppose I change this port number to 1533 and restarted the SQL server.Now I
tries to connect to SQL server from a client.What will happnen on client side
while making connections related to this port number?
With rgds
You will need to change the port the client looks for as well. Open the
client network utility and you will see a Properties button that will allow
you to set the TCP port that the client will use by default.
Andrew J. Kelly SQL MVP
"Rajendra" <Rajendra@.discussions.microsoft.com> wrote in message
news:3B2040E2-9C6A-4941-B442-AD8A265A4765@.microsoft.com...
> Hi,
> As we know,SQL server listens on port 1433 by default. Is there any
> dependency between client and SQL server for this port number?I mean, how
> will know the client that on which port the target SQL server listens?
> Suppose I change this port number to 1533 and restarted the SQL server.Now
> I
> tries to connect to SQL server from a client.What will happnen on client
> side
> while making connections related to this port number?
> With rgds
|||Hi Andrew,
Thanx for the reply. But if I am right then I think there is no need to make
change on client side.Suppose, u r having two computers C1 and C2.C1 is
having SQL server installed and C2 does not. The C2 computer has only
required files to make connection from SQL server.Now, I change the default
port of C1 to 1533 from 1433. The C2 has a VB application and try to connect
from C1 SQL server database and and got success.I have checked this.Then
where is need to change the port on client side?
I just want to ask whether there is any dependency on changing default port
no C1 fro SQL server to C2?
Thanx and regards,
"Andrew J. Kelly" wrote:

> You will need to change the port the client looks for as well. Open the
> client network utility and you will see a Properties button that will allow
> you to set the TCP port that the client will use by default.
> --
> Andrew J. Kelly SQL MVP
>
> "Rajendra" <Rajendra@.discussions.microsoft.com> wrote in message
> news:3B2040E2-9C6A-4941-B442-AD8A265A4765@.microsoft.com...
>
>
|||You must still have port 1434 open. SQL Server uses port 1434 to establish
connections with clients. They interrogate this port to find suitable Sql
Server hosts but the actual data is sent thru 1433 or what ever port you
changed it to. There is plenty of good information in BooksOnLine. You
might want to try starting here: "Net-Library, overview"
Andrew J. Kelly SQL MVP
"Rajendra" <Rajendra@.discussions.microsoft.com> wrote in message
news:15C84574-02D6-4BDD-8A90-A36530D22751@.microsoft.com...[vbcol=seagreen]
> Hi Andrew,
> Thanx for the reply. But if I am right then I think there is no need to
> make
> change on client side.Suppose, u r having two computers C1 and C2.C1 is
> having SQL server installed and C2 does not. The C2 computer has only
> required files to make connection from SQL server.Now, I change the
> default
> port of C1 to 1533 from 1433. The C2 has a VB application and try to
> connect
> from C1 SQL server database and and got success.I have checked this.Then
> where is need to change the port on client side?
> I just want to ask whether there is any dependency on changing default
> port
> no C1 fro SQL server to C2?
> Thanx and regards,
> "Andrew J. Kelly" wrote:

Change default port no.

Hi,
As we know,SQL server listens on port 1433 by default. Is there any
dependency between client and SQL server for this port number?I mean, how
will know the client that on which port the target SQL server listens?
Suppose I change this port number to 1533 and restarted the SQL server.Now I
tries to connect to SQL server from a client.What will happnen on client sid
e
while making connections related to this port number?
With rgdsYou will need to change the port the client looks for as well. Open the
client network utility and you will see a Properties button that will allow
you to set the TCP port that the client will use by default.
Andrew J. Kelly SQL MVP
"Rajendra" <Rajendra@.discussions.microsoft.com> wrote in message
news:3B2040E2-9C6A-4941-B442-AD8A265A4765@.microsoft.com...
> Hi,
> As we know,SQL server listens on port 1433 by default. Is there any
> dependency between client and SQL server for this port number?I mean, how
> will know the client that on which port the target SQL server listens?
> Suppose I change this port number to 1533 and restarted the SQL server.Now
> I
> tries to connect to SQL server from a client.What will happnen on client
> side
> while making connections related to this port number?
> With rgds|||Hi Andrew,
Thanx for the reply. But if I am right then I think there is no need to make
change on client side.Suppose, u r having two computers C1 and C2.C1 is
having SQL server installed and C2 does not. The C2 computer has only
required files to make connection from SQL server.Now, I change the default
port of C1 to 1533 from 1433. The C2 has a VB application and try to connect
from C1 SQL server database and and got success.I have checked this.Then
where is need to change the port on client side?
I just want to ask whether there is any dependency on changing default port
no C1 fro SQL server to C2?
Thanx and regards,
"Andrew J. Kelly" wrote:

> You will need to change the port the client looks for as well. Open the
> client network utility and you will see a Properties button that will allo
w
> you to set the TCP port that the client will use by default.
> --
> Andrew J. Kelly SQL MVP
>
> "Rajendra" <Rajendra@.discussions.microsoft.com> wrote in message
> news:3B2040E2-9C6A-4941-B442-AD8A265A4765@.microsoft.com...
>
>|||You must still have port 1434 open. SQL Server uses port 1434 to establish
connections with clients. They interrogate this port to find suitable Sql
Server hosts but the actual data is sent thru 1433 or what ever port you
changed it to. There is plenty of good information in BooksOnLine. You
might want to try starting here: "Net-Library, overview"
Andrew J. Kelly SQL MVP
"Rajendra" <Rajendra@.discussions.microsoft.com> wrote in message
news:15C84574-02D6-4BDD-8A90-A36530D22751@.microsoft.com...[vbcol=seagreen]
> Hi Andrew,
> Thanx for the reply. But if I am right then I think there is no need to
> make
> change on client side.Suppose, u r having two computers C1 and C2.C1 is
> having SQL server installed and C2 does not. The C2 computer has only
> required files to make connection from SQL server.Now, I change the
> default
> port of C1 to 1533 from 1433. The C2 has a VB application and try to
> connect
> from C1 SQL server database and and got success.I have checked this.Then
> where is need to change the port on client side?
> I just want to ask whether there is any dependency on changing default
> port
> no C1 fro SQL server to C2?
> Thanx and regards,
> "Andrew J. Kelly" wrote:
>

change default port

We have a lot of applications dependent upon SQL at the moment. If i change
my default port number of 1433, is there something I need to add/modify to
the existing connection info from my clients or will it just work ?
Using SQL 2KHassan
Yes , you will have to add with connection string
server=MyServer,Portnumber;
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:%23JS5jIdTFHA.2128@.TK2MSFTNGP14.phx.gbl...
> We have a lot of applications dependent upon SQL at the moment. If i
change
> my default port number of 1433, is there something I need to add/modify to
> the existing connection info from my clients or will it just work ?
> Using SQL 2K
>|||... or us Client Network Utility on the client machines.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Uri Dimant" <urid@.iscar.co.il> wrote in message news:eKIJZChTFHA.2520@.TK2MSFTNGP09.phx.gbl.
.
> Hassan
> Yes , you will have to add with connection string
> server=MyServer,Portnumber;
>
> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:%23JS5jIdTFHA.2128@.TK2MSFTNGP14.phx.gbl...
> change
>sql

change default port

We have a lot of applications dependent upon SQL at the moment. If i change
my default port number of 1433, is there something I need to add/modify to
the existing connection info from my clients or will it just work ?
Using SQL 2K
Hassan
Yes , you will have to add with connection string
server=MyServer,Portnumber;
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:%23JS5jIdTFHA.2128@.TK2MSFTNGP14.phx.gbl...
> We have a lot of applications dependent upon SQL at the moment. If i
change
> my default port number of 1433, is there something I need to add/modify to
> the existing connection info from my clients or will it just work ?
> Using SQL 2K
>
|||... or us Client Network Utility on the client machines.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Uri Dimant" <urid@.iscar.co.il> wrote in message news:eKIJZChTFHA.2520@.TK2MSFTNGP09.phx.gbl...
> Hassan
> Yes , you will have to add with connection string
> server=MyServer,Portnumber;
>
> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:%23JS5jIdTFHA.2128@.TK2MSFTNGP14.phx.gbl...
> change
>

change default port

We have a lot of applications dependent upon SQL at the moment. If i change
my default port number of 1433, is there something I need to add/modify to
the existing connection info from my clients or will it just work ?
Using SQL 2KHassan
Yes , you will have to add with connection string
server=MyServer,Portnumber;
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:%23JS5jIdTFHA.2128@.TK2MSFTNGP14.phx.gbl...
> We have a lot of applications dependent upon SQL at the moment. If i
change
> my default port number of 1433, is there something I need to add/modify to
> the existing connection info from my clients or will it just work ?
> Using SQL 2K
>|||... or us Client Network Utility on the client machines.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Uri Dimant" <urid@.iscar.co.il> wrote in message news:eKIJZChTFHA.2520@.TK2MSFTNGP09.phx.gbl...
> Hassan
> Yes , you will have to add with connection string
> server=MyServer,Portnumber;
>
> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:%23JS5jIdTFHA.2128@.TK2MSFTNGP14.phx.gbl...
>> We have a lot of applications dependent upon SQL at the moment. If i
> change
>> my default port number of 1433, is there something I need to add/modify to
>> the existing connection info from my clients or will it just work ?
>> Using SQL 2K
>>
>

Monday, March 19, 2012

Change connection port in SSMSE

Where can I chage the port for a connection to a SQL server using a non standard port. In SEM, I used the Client Network Utility, but I cannot find it anymore. There does not seem to be one for SSMSE. Any help is appreciated.

Thanks!

You can use the syntax MachineName,portnumber (without instance name) it should redirect you to the designated instance.

Jens K. Suessmeyer

http://www.sqlserver2005.de

Wednesday, March 7, 2012

Challenge revisisted

Hi,
I'm trying to port som old access code to asp.net and the access solution ha
s a couple of queries to sql server that I'm not sure work as expected. I t
hink the idea of the query is to identify if the same event (slaugher of rei
ndeer) is registered in two
different places (field 5 in my last challenge), but two duplicate rows diff
ering only by place does not get selected by the query.
The query is as follows:
SELECT ImportID FROM Temp t WHERE ( EXISTS (
SELECT Year, Code1, Code2, Date FROM (
SELECT DISTINCT Year, Code1, Code2, Date , Place FROM Temp ) SUBQUERY
WHERE ( t.Year = SUBQUERY.Year )
AND ( t.Code1 = SUBQUERY.Code1 )
AND ( t.Code2 = SUBQUERY.Code2 )
AND ( t.Date = SUBQUERY.Date)
GROUP BY Year, Code1, Code2, Date
HAVING (COUNT(*) > 1) ))
Can anyone see if this query does anything useful?, or perhaps give me a que
ry that selects rows with same Year,Code1,Code2,Date, but with different Pla
ce.
The other query is essentially the same, using Zone instead of Place
Morten WennevikOn Mon, 14 Nov 2005 08:51:43 +0100, Morten Wennevik wrote:

>Hi,
>I'm trying to port som old access code to asp.net and the access solution has a cou
ple of queries to sql server that I'm not sure work as expected. I think the idea o
f the query is to identify if the same event (slaugher of reindeer) is registered in
tw
o different places (field 5 in my last challenge), but two duplicate rows differing only by
place does not get selected by the query.
>The query is as follows:
>SELECT ImportID FROM Temp t WHERE ( EXISTS (
> SELECT Year, Code1, Code2, Date FROM (
> SELECT DISTINCT Year, Code1, Code2, Date , Place FROM Temp ) SUBQUERY
> WHERE ( t.Year = SUBQUERY.Year )
> AND ( t.Code1 = SUBQUERY.Code1 )
> AND ( t.Code2 = SUBQUERY.Code2 )
> AND ( t.Date = SUBQUERY.Date)
> GROUP BY Year, Code1, Code2, Date
> HAVING (COUNT(*) > 1) ))
>Can anyone see if this query does anything useful?, or perhaps give me a qu
ery that selects rows with same Year,Code1,Code2,Date, but with different Pl
ace.
>The other query is essentially the same, using Zone instead of Place
>Morten Wennevik
Hi Morten,
I'm not sure what you want eactly. If you want to find year / code1 /
code2 / date combinations for which more than one row exist, use:
SELECT Year, Code1, Code2, Date, COUNT(*)
FROM Temp
GROUP BY Year, Code1, Code2, Date
HAVING COUNT(*) > 1
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

Chain transact sql scripts

I have two Transact SQL scripts and I want to call the second script from the first –
is this possible in SQL server 2005?
I am trying to do a port from Oracle (where this is possible) but cannot find the mechanism to do so in SQL Server.

Eg if Script1.sql is
BEGIN
PRINT (‘Inside Script1’)
//Invoke Script2.sql – how do I do this?
END

where Script2.sql is
BEGIN
PRINT (‘Inside Script2’)
END

When I execute Script1.sql - I need it to print both 'Inside Script2' and 'Inside Script1'

You can do this using the :r command if you invoke the script using the new SQLCMD command-line utility. It also has other script pre-processing features. You can take a look at the Books Online topic at link below:

http://msdn2.microsoft.com/en-us/library/ms162773(SQL.90).aspx

|||We can use the :r option inside sqlcmd - but was looking for Transact SQL support (without using xp_cmdshell to spawn "sqlcmd" inside a larger script) - Inside a Oracle pl/sql script, we use "@.<scriptname> from a enclosing script" - was looking for similar functionality in Transact SQL|||

I would suggest the best way would be to place the code inside two stored procedures, and call one from the other.

HTH

|||

shuges is right

store procedure can call another sp

using the exec "spname" syntax

also sql queries can be nested so it is possible to

rewrite two sps into one.

moreover you can also make use of functions

|||The :r SQLCMD command is the equivalent of @. command in SQLPLUS. These are client-side features not part of the TSQL or PL/SQL language.