|
Actually this is happening for only one db and for an insert query as well as for update , whereas it was normal before.And i'm running this query on a table which has no relations with other tables that's why it sounds weird for me! The time taken the 1st time to be executed is 30-60sec!
so if a user wants to insert a new record for this table, it will give him a timeout expired.
so to resolve this problem temporarily, I run an insert query in the query analyzer (wich will take a long time) and by then the user will able to insert or update normally(bcoz data pages are in memory buffer) and so the query will run faster.
But this is not a final issue, so any other suggestion?
Thx in advance
|
|
|
|
|
Maira K wrote: whereas it was normal before
Have any changes top the server/database been made? Thats about all I can think of, sorry.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
private void UpdateDB()
{
if (lblBilledItemTotal.Text == "")
{
lblBilledItemTotal.Text ="0";
}
double billedTotal = Convert.ToDoubl(lblBilledItemTotal.Text);
double billDisc = Convert.ToDouble(txtBillDiscCash.Text);
double netPayable = Convert.ToDoubl(lblNetPayableAmount.Text);
po.AddBillData(billedTotal, billDisc, netPayable, DateTime.Now.ToShortDateString());
ClearDS();
ds = po.GetLatestBillNo();
int billNo = Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray.GetValue(0));
foreach (DataGridViewRow dgR in dgItems.Rows)
{
if (dgR.Cells["dgColProdCode"].Value != null)
{
itemCode = dgR.Cells["dgColProdCode"].Value.ToString();
itemName = dgR.Cell["dgColItemDescription"].Value.ToString();
itemPrice = Convert.ToDouble(dgR.Cells["dgColPrice"].Value);
itemQty = Convert.ToInt32(dgR.Cells["dgColQuantity"].Value);
itemDiscCash = Convert.ToDouble(dgR.Cells["dgColItemDiscCash"].Value);
itemDiscPercent = Convert.ToDouble(dgR.Cells["dgColItemDiscPercent"].Value);
itemTotal = Convert.ToDouble(dgR.Cells["dgColTotal"].Value);
po.AddSalesData(billNo, itemCode, itemName, itemQty, itemDiscCash, itemDiscPercent, itemPrice, billedTotal, DateTime.Now);
}
}
IDictionaryEnumerator myEnum = ht_ItemQty.GetEnumerator();
int qty;
while (myEnum.MoveNext())
{
qty = Convert.ToInt32(po.GetProdQty(myEnum.Key.ToString()).Tables[0].Rows[0].ItemArray.GetValue(0));
qty = qty - Convert.ToInt32(ht_ItemQty[myEnum.Key]);
po.UpdateStock(myEnum.Key.ToString(), qty);
}
}
|
|
|
|
|
And your question is?
You need to provide more than just the source code. I'm guessing there is something wrong with it. So what is wrong with it? What should it do? What does it do? What error are you getting? Where is the error occurring?
|
|
|
|
|
hello everyone , iam sorry for being far from this forum from along time but it is out of my hands . ok !
now there is a problem or a difficulty for me to completely design this database , using this case study
"we have 50 materials available for students to study.
each term , every student has the ability to sign only 3 materials only of his choice from the above 50 materials , suppose that this student failed in one of them so the next term will only sign two with the material he failed in so the total is also 3 materials in each term , and there are some materials if he failed in them render him from taking some other materials which are related to the materials he failed in , explain further .
suppose that student failed in material B and material G is built in knowledge upon material B thus he can't choose material G except if he succeeded in B first .
so i am suppose to design this database for student result examination i don't know really how the database could be designed ???
any help please .
Human knowledge belongs to the world.
|
|
|
|
|
hi
i am trying to create linked server on sql server with mysql database that is replicated (slave) database. is it possible??
|
|
|
|
|
yes--please use google for general questions such as these
|
|
|
|
|
I am starting on a new project and see how powerful LINQ is. One thing I need to know before we begin is if there will be any problems using LINQ to run queries against a Sun (Oracle) Database server. Any input is welcome.
Thanks!
|
|
|
|
|
LINQ does not currently work directly with Oracle. However, you can use LINQ to Datasets if that is of any help.
|
|
|
|
|
I would like to specify a default value for a column that increments along with the row number/identity column.
i.e. Insert tbl_User (some_data) VALUES (test)
resulting in
User_id first_name last_name some_data
1 Test User 1 test
I was sure there was something like @@row_number, but searching on msdn/google has turned up nothing useful so far...
Any suggestions?
Thanks,
Al
|
|
|
|
|
Set your default value to something like
'Test' + CAST(DATEPART(second, GETDATE()) AS VARCHAR)
or for more randomness
'Test' + CAST(DATEPART(second, GETDATE()) AS VARCHAR) + CAST(DATEPART(ms, GETDATE()) AS VARCHAR)<br />
You'll get fairly random data, not entirely unique though.
SG
Cause is effect concealed. Effect is cause revealed.
|
|
|
|
|
Thanks - perfect for what I need!
|
|
|
|
|
use sonia
create table stud(roll int identity(10,2),name varchar)
insert into stud values('A')
insert into stud values('B')
select * from stud
**IDENTITY(10,2) --> 10 is the initial value
2 is the number by which the value is to be incremented.
U can also decrement the value.
|
|
|
|
|
Hallo
We have set up Replication in several locations the SQL Server Enterprise Edition which is the Publisher is running on a different location while the Subscribers are running SQL express Edition which use Windows Synchronization as it does not have agents. The problem is users entering Passwords each and every time the Synchronization starts is there a way to enter the database only once and save it to the client Computers?
|
|
|
|
|
I'm using SQL server 7. Unfortunetly, the database I'm working with was not designed very well to restrict the date format input by the user. I need to change a table's column [IncidentDate] from a format of mm/dd/yyyy (12/25/2008) to a format of ddmmmyy (25DEC08). There are over 3,000 entries within this column that have a mixture of these two formats. I'm not sure exactly how I would accomplish this task. I tried using SQL Server Enterprise Manager's export/import tool to place the data into an Excel spreadsheet, manipulate the dates, and then import back into the database. I come close to resolving my issue, but I always get an error in the import function.
Any help is appreciated.
|
|
|
|
|
make while loop in TSQL, and format is this SELECT CONVERT(VARCHAR(9), GETDATE(), 6) AS [DD MON YY] br mode="hold" />
>
I Love T-SQL
|
|
|
|
|
Thank you. I'll give this a shot and let you know how it worked out.
|
|
|
|
|
If it won't work then ask again.
I Love T-SQL
|
|
|
|
|
Hi EveryOne,
I am savitri here.I am using ODBC in VC++ programs.I am Inserting values in the tables.If i want to Edit/Update Those values how Can I do it.if i clicked on the values those are come on the text boxes in that i want to edit after clicking button those values should be updated.Please tell me How can i Do it.
I am not getting idea how to get back the values on text boxes.
PLEASE HELP ME.
THANKS IN ADVANCE,
savitri
|
|
|
|
|
the way how u execute Insert command then do it with update same thing. or share your insert code and probably we can find how to execute update command.
I Love T-SQL
|
|
|
|
|
Hey guys
im having a slight problem with the above query, the problem is the value in the variable is like this "23:00" and the value in the table is "01-01-2008 23:00:00.000"
how can i get the query to return the row i need irrespective of the date that is attached to the time?
thanx,
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
select convert(varchar(10),columnname,108) from myTable it will return this format HH:mm:ss
hope it helps to you...
I Love T-SQL
|
|
|
|
|
thanx dude, im sure it will work!
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
I guess it will work for you
I Love T-SQL
|
|
|
|
|
Oh, that's handy! i didn't know there was such easy conversion!
|
|
|
|