Bulk UPDATE in LINQ for SQL

  • Thread starter Thread starter Shimon Sim
  • Start date Start date
S

Shimon Sim

Is it possible to create following query in LINQ for SQL

UPDATE Employee SET Salary= Salary * 1.5 WHERE Employee.Job='Developer'
(Don't you like this query :-)?)
Thanks,
Shimon.
 
LINQ is not SQL. It is designed to query, not perform bulk CRUD. You can set
up LINQ to set up the objects and then set all to the value and update, but
this is a job I think would be better performed on the datbase personally.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

*************************************************
| Think outside the box!
|
*************************************************
 
LINQ is not SQL. It is designed to query, not perform bulk CRUD. You can set
up LINQ to set up the objects and then set all to the value and update, but
this is a job I think would be better performed on the datbase personally.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my bloghttp://gregorybeamer.spaces.live.com/lists/feed.rss

*************************************************
| Think outside the box!
|

Well, that's true, but you can execute the OPs sql using the
DataContext.ExecuteCommand or DataContext.ExecuteQuery methods.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top