April 19, 2010 at 10:22 pm
I have installed SQLSERVER 2005 Express edition on windiows server 2003 machine. I am not able to connect to the SQL server from other machine on network via ip adress of server. Connecting via hostname is working.
Please suggest
April 19, 2010 at 10:38 pm
you need to do IP\Instance, or IP,port for the servername: you need to know which port the express is using;
192.168.1.100\SQLEXPRESS
192.168.1.150,1744
i think this script will help find the listening port:
CREATE TABLE #GetPort
(
token varchar(100),
value varchar(20))
go
DECLARE @inst varchar(200)
DECLARE @inst1 varchar(100)
--Determine registry path and key
IF(charindex('\',@@servername) > 0)
BEGIN
SELECT @inst = substring(@@servername,charindex('\',@@servername) ,50)
SELECT @inst = 'SOFTWARE\Microsoft\Microsoft SQL Server'+@inst+'\MSSQLServer\SuperSocketNetLib\Tcp'
--SELECT @inst1 = 'TcpDynamicPorts'
SELECT @inst1 = 'TcpPort'
END
ELSE
BEGIN
if SUBSTRING(@@VERSION,23,1) = '7'
begin
SELECT @inst = 'SOFTWARE\Microsoft\MSSQLServer\Client\SuperSocketNetLib\VIA'
SELECT @inst1 = 'DefaultServerPort'
end
else
begin
SELECT @inst = 'SOFTWARE\Microsoft\MSSQLServer\Client\SuperSocketNetLib\Tcp'
SELECT @inst1 = 'DefaultPort'
end
END
print @inst + '\\\\////'+ @inst1
INSERT #GetPort
EXEC master..xp_regread 'HKEY_LOCAL_MACHINE', @inst, @inst1
SELECT substring(@@servername,1,25) as ServerName, value as port FROM #GetPort
DROP TABLE #GetPort
Lowell
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply