|
I have the following select query
SELECT t1.* FROM t1, t2 WHERE t1.field1=t2.field1 And t1.field2=t2.field2 And t1.field3=t2.field3 ;
I want to convert this into a delete query. how should i write it?
Started by tksy on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
What about this query:
DELETE FROM t1 WHERE t1.field1 IN ( SELECT t1.field1 FROM t1, t2 WHERENot 100% on access but does:
DELETE t1 FROM t1, t2 WHERE t1.field1=t2.field1 And t1.field2=t2.field2 And t1.field3=t2.field3 ;
Work?
....
|
|
Can you delete using criteria query?
I want to do:
DELETE bookmars WHERE userID = @userID
How can I do this with criteria?
Started by mrblah on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
The query "delete from Insurance insurance where id = 2" Here is the code of delete query hql = "delete from Insurance insurance where id = 2"; Query query = sess.createQuery(hql); int rowCheck out this....
|
|
How can i call the delete store procedure in linq query
Started by Don Of Qau on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
The stored procedure....
I've not used LINQ, but if you can execute raw SQL, then it'd just be:
DROP PROCEDURE myStoredProcedure
Simply add the stored procedure that does the deletion to the database and then add the stored proceduere to your .dbml.
|
Ask your Facebook Friends
|
Possible Duplicate:
What’s the difference between TRUNCATE and DELETE in SQL
what is the difference between truncate and delete command in sql query
Started by kailashnkute on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Delete permits a where clause, allowing.
Delete marks each row logged mode) or marks the page as being altered (in bulk logged).
Just have a look around.
That's been answered quite a few times here.
|
|
Hi, i have two tables connected by a foreign key with a one to many relation.
in entity A i have the following :
@org.hibernate.annotations.Cascade( { org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN }) @OneToMany...
Started by DoviG on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You can use a native query, the following should work in....
You can setup a foreign key with the parameter on delete cascade so that when the key it references is deleted all rows that it is a foreign key on are also deleted.
|
|
I have a query like
DELETE from tablename where colname = value;
which takes awfully long time to execute. What could be the reason? I have an index on colname.
Started by Ajay on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Before you delete you should make sure noone else is locking the rows, eg: issue SELECT NULL FROM tablename....
There could be several explanations as to why your query takes a long time:
You could be blocked by another session (most likely).
|
|
Hi All,
Is there a possibility that a simple delete query can bring down a DB?
We executed a delete query (single row deletion) and that query hung. When multiple people tried executing the same delete again, the Oracle DB is down. Multiple tables reference...
Started by RJ on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
The delete stmts hung, the db reached max number of allowed processes (which were waiting.
My guess is that the delete modified a lot of rows and you ran out of UNDO log.
Files of the server.
|
|
Can someone help me understand what's wrong with this query:
DELETE FROM noteproject INNER JOIN note ON noteproject.noteID = note.noteID INNER JOIN person ON note.personID = person.personID WHERE noteID = '#attributes.noteID#' AND personID = '#attributes...
Started by nobosh on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
The effect is that....
Alternatively, you can write:
DELETE multiple tables in a DELETE statement to delete rows from one or more tables depending) are deleted.
Should be:
DELETE noteproject FROM noteproject INNER JOIN ...
|
|
I have stored procedure:
ALTER PROCEDURE [dbo].[k_ShoppingCart_DELETE] @cartGUID nvarchar AS DELETE FROM [dbo].[k_ShoppingCart] WHERE CartGUID = @cartGUID
When I execute this sp;
exec dbo.k_ShoppingCart_DELETE '32390b5b-a35a-4e32-8393-67d5629192f0'
result...
Answer Snippets (Read the full thread at stackoverflow):
Just working "dbo" while the ad-hoc ....
I try to Delete a City with City.Name in City table, it doesnt work too.
But this is not the problem.
With "dbo" in the query and in the sproc (who knows, you might have another version of the same.
|
|
Linq to Sql handles every insert/delete/update operation on an object with separate query. Is there a way to unite multiple operations in single query?
I know this is not possible with the default behavior of the framework. I'm looking for an extension...
Started by Branislav Abadjimarinov on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Hope it helps....
A-mass-update-delete-query-in-linq/1953244#1953244
It's a link to how to implement a batch updateLINQ to SQL does not give you a way to specify a set-based update/delete against the database, batch delete ...
|