Showing posts with label connecting. Show all posts
Showing posts with label connecting. Show all posts

Monday, March 12, 2012

problem while creating index for temporary table...

Hi,

i have created index for a temporary table and this script should used by multiusers.So when second user connecting to it is giving index i mean object already exists.

So what i need is when the second user connected the script should create one more index on temporary table.Will sql server provide any random way of creating indexes if the index exists already with that name?

Thank You,

Seeing the actual script will be helpful.

What advantage do you think you get from creating multiple (identical) indices on the same table?

|||

Nope..

SQL Server is cleaver enough to handel this situation.

When you create a index or constraint on the Temp Table, eventhough the index name is duplicate it will allow.

But it only possible on temp tables (prefixed with single #).

To Test this,

Open Two window,

Execute the below window on the opened 2 window..

create table #test

(

id int

);

Insert Into #test values(1);

Insert Into #test values(2);

Create clustered index testindex on #test(id)

Now you wont get any error on any of the window. Rite?

To fetch the created index details, execute the below code on any one of the window..

select * from sysindexes where name like '%test%'

Now you can see the 2 rows with same indexname but refereing with different table. Yes. all the temp tables (#) will be suffixed with unique number to avoid the object already found error while multiple users connects.

Problem while connecting to a remote SQL Server through VS.NET1.1

Hi All..

I am having a problem while connecting to a remote sql server through VS.NET 1.1 , an asp.net application. It says :"SQL Server does not exist or access denied".

I have connected to the same server from my home using the same connection string through an asp.net 1.1 app.. So it cant b a prob with Server permissions. I can connect to the same server frm my office through asp.net2.0 app.. So its got nothing to do with office permissions.

I need this connection from my office from asp.net1.1 app 2 debug n find solution for a bug as im unable to simulate it here.

Will this be smth to do with .net installation, some security enabled in vs.net.. I have no idea.. Please help me at the earliest..

Thanks in advance..

aLLEN

Hi Allen,

First, please try to ping the server to see if you can connect to it. Then check if the SQL Server is the default instance. If not, you will need to add instance name after server name in your connection string.

You can try to use SQL Authentication to connect again. If that still doesn't work, please post your connection string here.

Friday, March 9, 2012

Problem when connecting to a named sql 2000 instance

Hi,
I have a problem when connecting to a named sql 2000 instance . The instance
is running in a 2 node cluster configuration. The second instance on the
other node works fine.
When I try to connect with a client on another pc, the connection only works
when I set the correct (static) port number.
But if I leave it to dynamically determine ports it is not able to connect.
There is no firewall between the client pc and the database server
and udp port 1434 is listening.
Stranger is that this problem also occurs on the server itself. When i
connect to the servernode where the instance of sql is running,
i have to set an alias with the portnumber to be able to connect to the
instance. Without this the connection fails.
Anybody any idea(s)?
Regards,
CihatUnfortunately no response. Here my response so that others with same problem
maybe solve it more quickly. When this happens and all checks appear okey,
you have to failover the group and reboot the server where this problem
occur. After the reboot it worked fine for me. Still dont know the cause, bu
t
it works now.
"Cihat" wrote:

> Hi,
> I have a problem when connecting to a named sql 2000 instance . The instan
ce
> is running in a 2 node cluster configuration. The second instance on the
> other node works fine.
> When I try to connect with a client on another pc, the connection only wor
ks
> when I set the correct (static) port number.
> But if I leave it to dynamically determine ports it is not able to connect
.
> There is no firewall between the client pc and the database server
> and udp port 1434 is listening.
> Stranger is that this problem also occurs on the server itself. When i
> connect to the servernode where the instance of sql is running,
> i have to set an alias with the portnumber to be able to connect to the
> instance. Without this the connection fails.
> Anybody any idea(s)?
> Regards,
> Cihat
>

Problem when connecting from remote location to SQL Server 2k SP 3

This is when using SA account trying the SQL Query
Analyzer. I get the error Msg 17, Level 16, State 1. I
can locally connect fine on the server itself using SQL
Query Analyzer. I'm using SQL Authentication.
When trying to connect I get:
Unable to connect to server (name of server)
Server: Msg 17, Level 16, State 1
[Microsoft][ODBC SQL Server Driver][DBNETLIB] SQL Server
does not exist or access denied.
I verified that the port is open on the firewall pointing
to the server. Also, this just started happening and was
working fine before. I've reset the SA password and
verified that I am putting in either the DNS entry or IP
address and get the same error. Any help diagnosing this
is greatly appreciated!
Hi Luke,
Try running the following command using ISQL.exe
ISQL -Stcp:ServerNameHere -Usa -Ppassword -Q"select @.@.version"
Look for the OS Error returned. This will help you troubleshoot the
problem.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.
|||When I run that command, I get the following:
DB-Library: Unable to connect: SQL Server is unavailable
or does not exist. Una
ble to connect: SQL Server does not exist or network
access denied.
Net-Library error 10061: ConnectionOpen (Connect()).
This is when running on the server. I can't connect
remotely of course.
|||Hi Luke,
The actual error is : 10061:
This means that the server is not listening on the port.
Restart MSSQLServer and verify that SQL is listening.
Check the NT Application logs and SQL Errorlogs. For SQL 2000 we print
this in the errorlog.
Also you can verify this by running netstat -an at the command prompt.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Problem when connecting from remote location to SQL Server 2k SP 3

This is when using SA account trying the SQL Query
Analyzer. I get the error Msg 17, Level 16, State 1. I
can locally connect fine on the server itself using SQL
Query Analyzer. I'm using SQL Authentication.
When trying to connect I get:
Unable to connect to server (name of server)
Server: Msg 17, Level 16, State 1
[Microsoft][ODBC SQL Server Driver][DBNETLIB] SQL Server
does not exist or access denied.
I verified that the port is open on the firewall pointing
to the server. Also, this just started happening and was
working fine before. I've reset the SA password and
verified that I am putting in either the DNS entry or IP
address and get the same error. Any help diagnosing this
is greatly appreciated!Hi Luke,
Try running the following command using ISQL.exe
ISQL -Stcp:ServerNameHere -Usa -Ppassword -Q"select @.@.version"
Look for the OS Error returned. This will help you troubleshoot the
problem.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||When I run that command, I get the following:
DB-Library: Unable to connect: SQL Server is unavailable
or does not exist. Una
ble to connect: SQL Server does not exist or network
access denied.
Net-Library error 10061: ConnectionOpen (Connect()).
This is when running on the server. I can't connect
remotely of course.|||Hi Luke,
The actual error is : 10061:
This means that the server is not listening on the port.
Restart MSSQLServer and verify that SQL is listening.
Check the NT Application logs and SQL Errorlogs. For SQL 2000 we print
this in the errorlog.
Also you can verify this by running netstat -an at the command prompt.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.