Sql(ÊÂÎï+Óαê)ʹÓ÷½·¨
--µ±Á½¸ö»òÁ½ÒÔÉϵIJÙ×÷Ҫô¶¼Ö´ÐУ¬ÒªÃ´¶¼²»Ö´ÐÐʱҪÓÃÊÂÎñ¡£
1. Sqlд·¨(ÊÂÎï+Óαê)
--¿ªÊ¼ÊÂÎñ
BEGIN TRAN
--²»ÏÔʾ¼ÆÊýÐÅÏ¢
SET NOCOUNT ON
DECLARE @ProjNo varchar(50),@CusNo varchar(50)
--ÉùÃ÷Óαê
DECLARE CRMPSContact_cursor CURSOR FOR
SELECT ProjNo
from CRMPSContact
WHERE ProjNo>0
--´ò¿ªÓαê
OPEN CRMPSContact_cursor
--È¡µÚÒ»ÐеÄÖµ¸øר°¸±äÁ¿: @ProjNo
FETCH NEXT from CRMPSContact_cursor
INTO @ProjNo
--È¡µÃ¿Í»§ºÅ
select @CusNo = CusNo
from CRMPSProjectM
where ProjNo = @ProjNo
--µÃµ½CRMPSContactÖÐijר°¸ºÅ¶ÔÓ¦µÄ¿Í»§ºÅ
update CRMPSContact
set CusNo = @CusNo
where ProjNo = @ProjNo
--Ö´ÐдíÎó»Ø¹ö
if @@error!=0
begin
rollback tran
return
end
--Òƶ¯Óαê,ÆäËüËùÓÐÐиüвÙ×÷(µ±µ½½áβʱÍ˳ö)
WHILE @@FETCH_STATUS = 0
BEGIN
--ÓαêÒƵ½ÏÂÒ»ÐÐ
FETCH NEXT from CRMPSContact_cursor
INTO @ProjNo
--È¡µÃ¿Í»§ºÅ
select @CusNo = CusNo
from CRMPSProjectM
where ProjNo = @ProjNo
--µÃµ½CRMPSContactÖÐijר°¸ºÅ¶ÔÓ¦µÄ¿Í»§ºÅ
update CRMPSContact
set CusNo = @CusNo
where ProjNo = @ProjNo
--Ö´ÐдíÎó»Ø¹ö
if @@error!=0
begin
rollback tran
return
end
END
--Ìá½»ËùÓбä¸ü
COMMIT TRAN
--¹Ø±ÕÓαê
CLOSE CRMPSContact_cursor
--ÊÍ·ÅÓαê
DEALLOCATE CRMPSContact
Ïà¹ØÎĵµ£º
µÚ1ÖÖ·½·¨£º
ÆóÒµ¹ÜÀíÆ÷
--¹ÜÀí
--ÓÒ¼üÊý¾Ý¿âά»¤¼Æ»®
--н¨Î¬»¤¼Æ»®
--<ÏÂÒ»²½>
--Ñ¡ÔñÄãÒª±¸·ÝµÄÊý¾Ý¿â
--<ÏÂÒ»²½>Ö±µ½"Ö¸¶¨Êý¾Ý¿â±¸·Ý¼Æ»®"ÕâÏî
--Ö¸¶¨´æ´¢±¸·ÝÎļþµÄλÖÃ,ÕâÀï¸ù¾ÝÐèҪѡÔñ±¸·Öµ½´Å´ø»¹ÊÇ´ÅÅÌ
--µ¥»÷µ÷¶ÈºóÃæµÄ"¸ü¸Ä"°´ ......
Èë Êƪ
Èç¹ûÄãÒÔǰûÊÔ¹ýSQL×¢ÈëµÄ»°£¬ÄÇôµÚÒ»²½ÏÈ°ÑIE²Ëµ¥=>¹¤¾ß=>InternetÑ¡Ïî=>¸ß¼¶=>ÏÔʾÓѺà HTTP ´íÎóÐÅϢǰÃæµÄ¹´È¥µô¡£·ñÔò£¬²»ÂÛ·þÎñÆ÷·µ»Øʲô´íÎó£¬IE¶¼Ö»ÏÔʾΪHTTP 500·þÎñÆ÷´íÎ󣬲»ÄÜ»ñµÃ¸ü¶àµÄÌáʾÐÅÏ¢¡£
µÚÒ»½Ú¡¢SQL×¢ÈëÔÀí
ÒÔÏÂÎÒÃÇ´ÓÒ»¸öÍøÕ¾www.19cn.com¿ªÊ¼£¨×¢£º±¾ÎÄ·¢±íÇ°ÒÑÕ÷µ ......
À´×Ô:http://www.cnblogs.com/mikeye/archive/2007/04/13/711878.html
ºÍÀ´×Ô:http://tech.ccidnet.com/art/3539/20080225/1370107_1.html
ÓÃeclipseÀ´½øÐÐMicrosoft SQL Server 2005Êý¾Ý¿â·½ÃæµÄ¿ª·¢£¬ÏÈ°ÑMS SQL Server 2005 JDBC DriverµÄÇý¶¯ÏÂÔغó¼ÓÈ빤³ÌÎļþµÄÀà¿âÖУ»È»ºóдURL×Ö·û´®¡£¸ù¾ÝÒÔÍùµÄд·¨Ð´È룺url = ......