|
Can anyone help me in understanding Locking and Transaction in SQL Server?
|
|
|
|
|
Lots of information can be found here[^]
|
|
|
|
|
I would like to detect if SQL Server is 'doing anything'. I know this is vague so a bit of background:
I have a GUI that starts a long set SQL server processes (its a financial model), and in order to overcome the extremely cack network we have, I start this SQL process via a SQL agent job, so that the 'server' owns the process rather than the user running the GUI.
Now I've got control logic in the sql, updating timestamps in tables etc, but I would like a 'backup' to this.
Originally I thought about using the sql server cpu activity which I can get via WMI, and some kinda of threshold value...so if cpu >33% then the server is likely to working and not idling?
But I just wondered if there was a better way?
I'm using SQL Server 2000 and VB6 (yea you can laugh!)
|
|
|
|
|
|
Hi all,
Can any one tell me how to delete the data from the database.
Thanks in advance.
|
|
|
|
|
Whatever database you are using, it must be having a delete command. Use it.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
i want to delete by using the query.
|
|
|
|
|
Why can't you google or use the help provided with database? This is so very trivial. Anyways, here you go (assuming you are using MS SQL):
Delete from tableName where [whatever condition you want to use]
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
If you don't even know how to use help, should you even consider doing a delete? Unless you know what you are doing you can lose more data than expected.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
I don't know your specific requirement, but I am giving certain situations. Let me know in case of any concern
General syntax:
DELETE FROM
{table name | view name}
[WHERE search_conditions]
Note: Where clause is optional
Case 1: Delete all rows from the table
Delete from tablename
Case 2: Delete based on a condition(Suppose I want to delete those employees from Employee table whose salaries are more than 50k)
Delete from Employees
where Salaries > 50000
Case 3: If you want to drop your table issue
DROP TABLE table_name
Case 4: Though you have not asked, but if incase you need to truncate your table issue :
Truncate Table table_name
Case 5: If you want to delete duplicate records like
Input:
id name
1 name1
10 name1
2 name2
3 name3
11 name3
4 name4
Output:
id name
1 name1
2 name2
3 name3
4 name4
Query:
delete from tblname where id in
(
select id
from(select ROW_NUMBER() over(partition by name order by name) rn,
Id, name from tblname)X
where rn <> 1
)
But your question title is
sarang_k wrote: delete the data from the database
Case 6:
If that is suppose to be the case, the I presume you want to drop the database (:(don't know why?)
However, the command is
Drop DataBase database_name
For more information please look into Deleting Data from an SQL Table
Hope this helps
Niladri Biswas
|
|
|
|
|
|
Mycroft Holmes wrote: When he comes back with "I can't truncate the table", you can try explaining foreign keys
Or Cascade.
|
|
|
|
|
Hi!
I need to connect remote mysql server and get the data. But I could not succeed it. I use reel IP address as serverIpAddress
MySqlConnection CN = new MySqlConnection("server=serverIPaddress;Port=3306; user=root; password=test; database=dbtest;");
Also I update my nat table to forward connections. But I get this error
A first chance exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll
Could you help me on this issue?
|
|
|
|
|
|
Yes. I have searched but I could not overcome this problem. It is not related with the string that I use. It is totaly about configuration settings on mysql.
|
|
|
|
|
Is that a database on your LAN, or is it located somewhere else? (e.g., a database from a webhosting company?)
I are Troll
|
|
|
|
|
Database is on another machine that is not in my LAN.
|
|
|
|
|
Then chances are that there's a firewall. Second thing to check would be if MySQL accepts remote connections - those are disabled by default[^], for security reasons.
I are Troll
|
|
|
|
|
Am using MS sql server 2005 database.
Table has 3 columns:
1)Id
2)Status
3)ExpireDate
If Expire Date is today then status has to become false otherwise true.
It has to done automatically. How to do it?
Please help me
|
|
|
|
|
|
I am working with asp.net and MS sql server 2005. I want send an automatic mail to those status is incomplete(In my database table one column has data like either "complete" or "incomplete").
When the status is "incomplete",then send a mail daily once to "so and so email id".
Please help me
|
|
|
|
|
This was already answered in the ASP.NET forum. Please do not spam.
|
|
|
|
|
|
Krishhhhhhhhhhhhhh wrote: Not Fully answered. OK
So wait until it is, please do not crosspost.
|
|
|
|
|
Stop this bloody replies and do ur job perfectly. otherwise close ur forums
|
|
|
|