|
Suppaman,
I have tried it both ways i.e. using "join on table1.id=table2.id" & using "where table1.id=table2.id".
The results from an Explain Select are identical. But I agree the on method is easier to read.
Thanks!
|
|
|
|
|
You can try using views:
first create a view to filter out elements of assemdata with Assemnum >=60000 and Assemnum <=60050 (50 elems) then join this view with the other two table. In this way the query plan should be different and the query execution faster (I think).
Bye ^__^
|
|
|
|
|
I am trying to run windows application against SQL Server 2000 and get error message dot net 2005 is developement environment
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)
Both app and SQL server are local
connection string is
""Data Source={m};Initial Catalog=dbname;Integrated Security = SSPI; Trusted_Connection=Yes;"
I have tried enabling TCPIP protocoll on 2005 server but it does not help.
Please help
Thanks
Manish
|
|
|
|
|
hrrty wrote: I am trying to run windows application against SQL Server 2000
hrrty wrote: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005
The error message says it all, your connection appears to think it should be connecting to SQL Server 2005.
You always pass failure on the way to success.
|
|
|
|
|
I have a column of telephone numbers that I am trying to get the most dialled number from. Can anyone help?
|
|
|
|
|
SELECT COUNT(*), TelephoneNumber
From MyTable
GROUP BY TelephoneNumber
You might want to put in an ORDER BY there too. If you are only interested in the highest value then:
SELECT TOP 1 COUNT(*), TelephoneNumber
From MyTable
GROUP BY TelephoneNumber
ORDER BY COUNT(*) DESC
|
|
|
|
|
What is the difference between Difference between Correlated and Simple Subqueries
|
|
|
|
|
.NET- India wrote: What is the difference between Difference between Correlated and Simple Subqueries
Have you not heard of a search engine[^]? I typed your question into Google and got plenty of results.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Please Friend dont give this type of answers. If you dont want to give me the annswer please dont give me but if you want to give me thnx
|
|
|
|
|
|
.NET- India wrote: Please Friend dont give this type of answers.
What do you mean? I gave you an answer to your question.
If you don't know how to use a search engine to find answers to questions, I suggest you read this article[^]. Being able to use a search engine is pretty much a prerequisite for being a developer, so I suggest you learn fast.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hi
I am using sql 2000 as database and windows form done in c# as the interface
I am having some 8 stored procedures in the project all are working fine except 1
Error which i got is ("Incorrect Syntax near SP_drivers")
i have checked it in DB by inserting values its working fine
but through interface its giving error
Thanks in Advance
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
Without seeing your C# code, it's hard to say what the problem could actually be.
|
|
|
|
|
its a bog code from here just i am passing parameters
connection = new SqlConnection(sql);
command = new SqlCommand("SP_Driver_WMile_Desc", connection);
connection.Open();
if (availability == true)
command.Parameters.AddWithValue("@Mode", "U");
else
command.Parameters.AddWithValue("@Mode", "I");
command.Parameters.AddWithValue("@Rate_ID", selected_node_parent);
command.Parameters.AddWithValue("@Vehicle_ID", selected_node);
command.Parameters.AddWithValue("@Drv_rate_ID", selected_driverrate);
if (rbtnWaitingDriverprice.Checked == true)
command.Parameters.AddWithValue("@Driver_Round_Type", true);
else
command.Parameters.AddWithValue("@Driver_Round_Type", false);
if (cboxWaitingDriver.SelectedItem.ToString() == "Up")
command.Parameters.AddWithValue("@Driver_Rounding", true);
else
command.Parameters.AddWithValue("@Driver_Rounding", false);
if (txtWatingDriverNearest.Text == "")
txtWatingDriverNearest.Text = "0";
command.Parameters.AddWithValue("@Driver_Nearest", txtDrivertonearest.Text);
for (i = 1; i <= 10; i++)
{
if (Waiting_Driver_Gridview[0, i - 1].Value == "")
command.Parameters.AddWithValue("@Driver_Mile_Box_" + i.ToString(), 0.00);
else
command.Parameters.AddWithValue("@Driver_Mile_Box_" + i.ToString(), Convert.ToDouble(Waiting_Driver_Gridview[0, i - 1].Value));
}
for (i = 1; i <= 10; i++)
{
if (Waiting_Driver_Gridview[1, i - 1].Value == "")
command.Parameters.AddWithValue("@Driver_Charge_Box_" + i.ToString(), 0.00);
else
command.Parameters.AddWithValue("@Driver_Charge_Box_" + i.ToString(), Waiting_Driver_Gridview[1, i - 1].Value);
}
command.ExecuteNonQuery();
connection.Close();
MessageBox.Show("Data Added Successfully ", "Data Adition", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
You don't have anything in your code to tell it that you are using a stored procedure. You need to set the command type to CommandType.StoredProcedure. By default, it will try to execute this as a straight forward piece of SQL.
|
|
|
|
|
Thank You very much ...actually got exhausted today because of heavy work
thank you once again
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
No problem. Glad to help.
|
|
|
|
|
I have HP 6767 (with vista OPerating system) NoteBook and SQL Server 2005 inbuild in opertaing system . but i can not access sql sever2005 so how i can access sql Please help me.
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Piyush Vardhan Singh wrote: and SQL Server 2005 inbuild in opertaing system
If you cannot access it, how do you know it is there?
|
|
|
|
|
|
Hello!
I have a table which has a text column.
I need to modify this column for all rows that begin with some text.
How can I do it?
Thanks in advance!
Have a nice day!
|
|
|
|
|
UPDATE table_name
SET column_name = new_value
WHERE column_name like '%some text'
You should really read up on SQL if you have to ask this kind of questions. I suggest you read w3schools[^] articles on sql.
|
|
|
|
|
i write store procedure for the time .it insert time in the database before inserting it check this time is already
exit or not .if exit it not allow me to insert and rasise error
butit not work it give error on starting "begin" statement
i don't understand where i am doing wrong
someone help me to reconver this error
CREATE PROCEDURE InsertTiming(@timing nvarchar(255))
BEGIN
SET NOCOUNT ON;
-- Check if timing already exists
DECLARE @tmp nvarchar(255);
SELECT @tmp = s_time FROM timing WHERE s_time = @timing;
IF @tmp IS NOT NULL
BEGIN
raiserror(N'Timing %s already assigned',
10,
1,
@timing);
END
-- Insert new value
INSERT INTO timing(s_test) VALUES (@timing);
END
okey
|
|
|
|
|
MSDN : CREATE PROCEDURE[^]
In short, you're missing the AS keyword before BEGIN.
SG
Cause is effect concealed. Effect is cause revealed.
|
|
|
|
|
i use as statement
but it give me error on
@timing
okey
|
|
|
|