問題描述:
最近給學校在做一個.NET網站,名字叫做文正學院過程化成績錄入系統,其中需要用到老用戶登陸系統需要從舊系統裡將以前存在的數據導入到新數據表中,
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 USE [new_wzjw] GO /****** Object: StoredProcedure [dbo].[成績管理_過程化成績錄入_數據遷移] Script Date: 2014/3/16 22:55:38 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO create proc [dbo].[成績管理_過程化成績錄入_數據遷移] @kcId jxrw_code/*自定義變量名*/ as begin begin try begin tran INSERT INTO [web_inputCj_xsxkb] ([xh] ,[xm],[xxxzdm],[xxxzmc],[cjxzdm],[kcid],[lrsj],[manuAdd]) select xh, xm, xxxzdm,xxxzmc, cjxzdm, kcid, lrsj, manualAdd from web_inputCj_cjb as a where a.kcId = @kcId and not exists ( select * from web_inputCj_xsxkb as b where a.xh = b.xh and a.kcId = b.kcid ) commit tran return 0 end try begin catch rollback tran return 1 end catch end