|
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
this was the complete error message. please note that i am connecting to sql server 2008 on a server and sql 2005 which is installed with visual studio 2005 is in the local machine.
|
|
|
|
|
karthi84 wrote: please note that i am connecting to sql server 2008 on a server
Are you positive about this?
I am asking because it seems weird to me that the error message mentions SQL Server 2005 (When connecting to SQL Server 2005 ...) when you are connecting to SQL Server 2008.
|
|
|
|
|
ya i am sure about that. i have installed sql 2008 ctp5 "Katmai" in my machine and have VS 2005 along with it. when i try to connect to the database through my application i get this error message.
thanks & regards
karthikeyan
|
|
|
|
|
Hello friends, Can we create record in sql server. (similar to record in oracle). to hold different datatype fields?
Amit
|
|
|
|
|
Well that has got to be one of the lamest questions I have EVER come across. PLEASE, please do some reading, do some reaserch, open your freakin eyes and THINK, SQL Server is a database, admittedly less robust/powerful than Oracle but right up there for functionality, how could it NOT support different data type in it's table format.
iamdking - you are an idiot. Sorry, could not resist and it may be unjustified but hey it's out there.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thank You.
For your kind reply. I know I am idiot. But the fact is that I just started working on SQL Server and didnt found any record type variable in msdn. Thats why I ask such stupid question. Offcourse I didnt get answer ..But thanks for your quick response.
Amit
|
|
|
|
|
See what you mean, I just tried searching msdn for datatypes and it took some finding. If you have enterprise manager the help in there is better for this, but the link below may be of help.
SQL Server
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Amit, I should apologise just because I had a cow of a day I should not have bitched at you.
And I really could not resist having a go at iamdaking moniker;)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi all,
I am using MySQL 5.0 database. I need to transfer the data from one table to another within a mysql database based on the particular time interval. Is it possible to transfer data among the tables a database automatically. Please help me.
Thanks in Advance,
J. Mohan
J. Mohan
|
|
|
|
|
Hmm I don't know about MySQL but most databases have no idea what time is. To do this you need a running process (to keep track of the time) and to periodically execute the transfer method. In SQL Server I would set it up as a job. If there is no concept of a job in MySQL then you may need to write an external process to do the scheduling for you.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
With the following table I am looking for suggestions on the best way to query the table for the follow criteria.
ID SalesID FKey FValue
1 1 12345 1.25
2 1 555 2.25
3 1 775 3.00
4 2 432 2.00
5 2 12345 1.00
6 3 321 1.11
7 3 223 1.00
8 4 12345 1.25
9 4 775 3.00
10 4 222 1.00
I need to query the table for the SalesID number for the sales that sold both '12345' and '775'. This would be only SalesIDs 1 and 4.
Querying FKey = '12345' OR FKey = '775' would return 1,2, and 4 and not just 1 and 4.
|
|
|
|
|
Can be done only using corelated subqueries
SELECT Distinct SalesID FROM fky a WHERE
EXISTS (SELECT * FROM fky b WHERE a.SalesID = b.SalesID AND fkey = 12345)
AND
EXISTS (SELECT * FROM fky c WHERE a.SalesID = c.SalesID AND fkey = 775)
Regards
KP
|
|
|
|
|
Thanks. This worked great.
|
|
|
|
|
Hi,
We have two tables and we views like:
1) create view ... select bno from A : we can create a clustered index on this view
2) create view ... select bno from B : we can create a clustered index on this view
3) create view ...
select A.bno
from A
LEFT JOIN B ON B.bno=A.bno
: we cannot create a clustered index for this view, it gives error like:
"... one or more disallowed construct"
How can we solve this problem.
Thanks for your help (:
|
|
|
|
|
Simple. You cannot have a clustered index on a multi-table view - you can on the underlying tables, but not the view. This is because a view does not actually exist in the database, it is effectively just a select statement. A clustered index physically orders the data and as a multi-table view does not have a physical presence it cannot be ordered. The clustered index you have created on the single tyable views have been applied to the underlying table.
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
So, how can we optimize that query to make it faster if we cannot declare an index?
What's the way to improve our performance?
Thanks.
|
|
|
|
|
Thats a whole can of worms. Firstly, outer joins are bad. Can it be avoided? Secondly, you can create a clustered index on each of the underlying tables, also a (non-clustered) index covering the columns in the view may help, but its really not possible to give a definative answer with only the limited oinformation yuo have supplied. Thirdly, how large are the tables? The whole table may be cached if they are small, so indexes are relatively unimportant in that case. What is the frequency of insert/update/delete from the underlying tables? More indexes means slower for these activities.
I could go on, but you get the idea, there is no simple answer.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I used to look for a definitive Yes/No answer to managing indexes, I have since come to the conclusion the DB tuning is an Art for NOT a science. There are so many factors that weigh differently on the results that each case is very individual. So I have a thumb rule - grab the fields used in the join and where clauses and create a index covering the most common 2/3 queries.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
We have found a sample that contains multi-table view and it has a clustered index, we tasted its create script and found the difference.
Multi-table views can have Clustered Index but it mustn't contain LEFT OUTER JOIN, in our view the select query defined like LEFT JOIN but we've just learned that LEFT JOIN means LEFT OUTER JOIN so we couldn't be able to create clustered index, the problem was JOIN statement.
That was all (:
|
|
|
|
|
Apologies, I got it wrong.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I have a SQL 2005 Express database (mdf) to which I am connecting from my application.
Table has two columns : ID (primary key, datatype int, allow NULL = false, identity = yes) and Name1 (datatype string).
When I use the "INSERT INTO table1 (Name1) VALUES (@Name1)"-command to create a new entry I get an error telling me NULL can't be inserted into the ID-column since NULL is not allowed. But I dont't want to give the ID-value to the database via my SQL-command but ID should automatically be the next value.
What am I missing in the column's settings?
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Hi,
Since you have set the ID column as Identity it will be incremented automatically whenever a new record inserted into the table. You do not need to supply values for ID field via SQL-Command.
Try following SQL Command this works fine for me.
Create table table1 (ID int primary key identity not null, Name1 VarChar(30))
insert into table1 (Name1) values ('John Adams1')
insert into table1(Name1) values ('John Adams2')
insert into table1(Name1) values ('John Adams3')
insert into table1(Name1) values ('John Adams4')
insert into table1(Name1) values ('John Adams5')
Select * from table1
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Thanks John.
John_Adams wrote: Create table table1 (ID int primary key identity not null, Name1 VarChar(30))
I think, that's exactly how I defined my ID-column in table definitions
Name: ID
data type: int
primary key
allow null = false
identity = yes (begin with 1, increase 1)
But when inserting a new row via INSERT-command I just receive this message telling me I am not allowed to insert NULL in ID. But I don't give a value for ID at all in my INSERT-command.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Have you switched IDENTITY_INSERT on by mistake?
SET IDENTITY_INSERT table OFF
Maybe a space between identity and insert, check the docs.
|
|
|
|
|
Thanks Mark. You are right, it was switched on. Now it works fine.
Thanks.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|