|
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
|
|
|
|
|
Krishhhhhhhhhhhhhh wrote: Stop this bloody replies and do ur job perfectly. otherwise close ur forums
This sort of language is not acceptable here, if you cannot behave like an adult you should find an alternative playground.
|
|
|
|
|
sure. y not? tell me......
|
|
|
|
|
This thread is at an end.
|
|
|
|
|
go to hell
|
|
|
|
|
Krishhhhhhhhhhhhhh wrote: 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".
There are multiple ways that you can solve this. May I suggest writing a console-application that makes a SqlConnection to verify the status? It would be quite trivial to send an email from C#, and you can launch the application using Windows' task-scheduler.
Krishhhhhhhhhhhhhh wrote: Stop this bloody replies and do ur job perfectly. otherwise close ur forums
We're not being paid to answer you, and these forums are not a "company" that exists to serve others. This is a meeting-space where all kinds of people can trade idea's. Consider it a public market
I are Troll
|
|
|
|
|
Hi All,
I am savitri here.New to this part of forum. I am doing one application for Psion Teklogix Device in VC# 2003.It is Windows CE 4.2. For that i am using Visual Studio 2003. I want to create database in device. I am not getting how to use sqlite operation in device programming. I am not getting any Dll's for that SQLite.
So please tell me how to create and connect in device level programming. Give me some hints or solution.I am searching alot but not got any result.Getting struck here only. please do needful for me.
Regards,
Savitri
|
|
|
|
|
savitri wrote: I am doing one application for Psion Teklogix Device in VC# 2003.
That's probably not an i386-based device. Have you checked whether it is compiled against the correct architecture?
savitri wrote: I am not getting any Dll's for that SQLite.
Here's a sweet alternative; you can download http://code.google.com/p/csharp-sqlite/[^] code, and include them directly in your project
I are Troll
|
|
|
|
|
Hi
I have a program that needs Microsoft Sql Server for my database .
Now i want to create an installer for my program with Installshield Software and i want to know what should i add to my installer for using sql database?
|
|
|
|