我们继续讲解LINQ to SQL语句,这篇我们来讨论Insert/Update/Delete操作.这个在我们的程序中最为常用了.我们直接看例子. Insert/Update/Delete操作 插入(Insert) 1.简单形式 说明:new一个对象,使用InsertOnSubmit方法将其加入到对应的集合中,使用SubmitChanges()提交到数据库. NorthwindDataContext db = new NorthwindDataContext(); var newCustomer…
http://blog.csdn.net/lanyuzhen/article/details/7547476 --大批量导出orders表:insert DBCC DROPCLEANBUFFERS DBCC FREEPROCCACHE goSET NOCOUNT ON BEGIN TRANSACTION INSERT INTO test.dbo.orders with(tablock) SELECT * FROM bak.dbo.OrdersWHERE ordertime BETWEEN '…
insert into test_tb output inserted.id,inserted.data values('c'),('d') delete from test_tb output deleted.id where data='c' update test_tb set data='abc' output inserted.id as ID ,deleted.data as old_data ,inserted.data as new_data where data='c' wit…