I am migrating an application from SqlClient to Entity Framework 4 while working with SQL Server. I have a situation where I have to copy multiple rows from one table to another, so I do this with INSERT ... SELECT, as shown below:
INSERT INTO dbo.Table1 (Reg1, Reg2, Reg3, Reg4, Reg5, Reg6, Reg7, Reg8) SELECT Reg1, Reg2, Reg3, Reg4, Reg5, @Reg6, GETDATE(), @Reg8 FROM dbo.Table2 WHERE Reg1 = @Reg1
Can I do something remotely similar to this with the Entity Framework, or will I need to get all the rows from table2 and insert them row by row in table1? How can I handle GETDATE ()?
Tks
sql-server entity-framework entity-framework-4
Pascal
source share