|
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.
|
|
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.
|
Ask your Facebook Friends
|
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).
|
|
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 ...
|
|
I have two tables: orders and orders_items. Both sharing the field orderID.
I want to delete all rows from both tables where orderID=500, but I need to do this in only one query. Is this possible?
Started by The Disintegrator on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Then, when the stored function is called it will run as a transaction and you can make it return ... .
This is as good as a cascading delete and the query can be expanded to span over both DELETE queries.
Atomic queries.
|
|
Hi,
One of the question asked in an interview was,
One table has 100 records. 50 of them are duplicates. Is it possible with a single query to delete the duplicate records from the table as well as select and display the remaining 50 records.
Is this ...
Started by swapna on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
query will delete duplicates and give you the rows that are deleted, not the rows that remainSounds unlikely, at least in ANSI SQL, since a delete only returns the count of the number INTO @Table VALUES (3, 200) INSERT INTO....
|