惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
L
LINUX DO - 热门话题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
V
V2EX
GbyAI
GbyAI
量子位
Microsoft Azure Blog
Microsoft Azure Blog
有赞技术团队
有赞技术团队
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
B
Blog
Microsoft Security Blog
Microsoft Security Blog
S
SegmentFault 最新的问题
O
OpenAI News
N
News and Events Feed by Topic
博客园 - Franky
爱范儿
爱范儿
Forbes - Security
Forbes - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V2EX - 技术
V2EX - 技术
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Schneier on Security
Schneier on Security
Cloudbric
Cloudbric
Security Archives - TechRepublic
Security Archives - TechRepublic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
人人都是产品经理
人人都是产品经理
P
Privacy International News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog RSS Feed
阮一峰的网络日志
阮一峰的网络日志
D
DataBreaches.Net
Last Week in AI
Last Week in AI
罗磊的独立博客
Spread Privacy
Spread Privacy
Recent Announcements
Recent Announcements
The Cloudflare Blog
Google DeepMind News
Google DeepMind News
AWS News Blog
AWS News Blog
The Register - Security
The Register - Security
Y
Y Combinator Blog
J
Java Code Geeks
I
Intezer

博客园 - 华博

SAP-续1 SAP專欄 也玩玩QQ的WEB(http://user.qzone.qq.com/7355541) 升職感言 - 华博 - 博客园 深深地記憶2007-07-09 重在參預:我眼中的東莞 勞動節到了,你准備好了嗎 四月一號去哪裡玩 新年來,又瘦下來了 Workflow培訓 方言武汉 最近相片,露個臉---SERVER 房間 RFID時代來臨了 一切源于基本 关于设计器类程序的模型,先抄下來,慢慢消化 System.ComponentModel.Component入门 避免死锁 c#中的回車jsp - 华博 - 博客园 spused
Cursor
华博 · 2006-02-15 · via 博客园 - 华博
DECLARE Employee_Cursor CURSOR FOR
SELECT EmployeeID, Title FROM AdventureWorks.HumanResources.Employee;
OPEN Employee_Cursor;
FETCH NEXT FROM Employee_Cursor;
WHILE @@FETCH_STATUS = 0
   BEGIN
      FETCH NEXT FROM Employee_Cursor;
   END;
CLOSE Employee_Cursor;
DEALLOCATE Employee_Cursor;
GO

CREATE   PROC  usp_ClearBarcode
AS
SET NOCOUNT ON

DECLARE @charMO varchar(16),@intClearID int,@intClearCount int
SET @charMO=''
SET @intClearID=0
SET @intClearCount=0
DECLARE csClearBarcode INSENSITIVE CURSOR 
FOR
SELECT ClearID,MO_Code FROM dbo.Clear_Barcode WHERE Finished=0 ORDER BY ClearID
OPEN csClearBarcode
FETCH NEXT FROM csClearBarcode
INTO
@intClearID,@charMO

WHILE @@FETCH_STATUS = 0
BEGIN
SET @intClearCount=@intClearCount+1
BEGIN TRAN  ClearBarcode
---------------------------
---Backup Barcode
--------------------------
INSERT BarcodeBackup..BarcodeBak  SELECT *,GETDATE() FROM  Barcode (NOLOCK)  WHERE MO_Code=@charMO and Isnull(Code,'')<>'VOID'
 IF @@ERROR <> 0
    BEGIN
      RAISERROR('Error occurred, cannot BACKUP  Barcode  %d', 16, 1, @charMO)
      ROLLBACK TRAN ClearBarcode
      GOTO RESUME_NEXT
  END 
-----delete barcode

DELETE Barcode WHERE MO_Code=@charMO
 IF @@ERROR <> 0
    BEGIN
      RAISERROR('Error occurred, cannot delete Barcode  %d', 16, 1, @charMO)
      ROLLBACK TRAN ClearBarcode
      GOTO RESUME_NEXT
  END 
------delete mo_bundle
DELETE MO_Bundle WHERE  MO_Code=@charMO
 IF @@ERROR <> 0
    BEGIN
      RAISERROR('Error occurred, cannot delete MO_Bundle  %d', 16, 1, @charMO)
      ROLLBACK TRAN ClearBarcode
      GOTO RESUME_NEXT
  END 
------delete mo_bundle_range
DELETE MO_Bundle_Range WHERE  MO_Code=@charMO
 IF @@ERROR <> 0
    BEGIN
      RAISERROR('Error occurred, cannot delete MO_Bundle_Range  %d', 16, 1, @charMO)
      ROLLBACK TRAN ClearBarcode
      GOTO RESUME_NEXT
  END 
-----update Clear_Barcode
UPDATE Clear_Barcode SET Finished=1,ClearedDateTime =getdate()  WHERE ClearID=@intClearID
 IF @@ERROR <> 0
    BEGIN
      RAISERROR('Error occurred, cannot update ClearBarcode  %d', 16, 1, @intClearID)
      ROLLBACK TRAN ClearBarcode
      GOTO RESUME_NEXT
  END 
COMMIT TRAN  ClearBarcode
IF @intClearCount % 10=0
  BEGIN
    DUMP TRAN PTP WITH NO_LOG
    DUMP TRAN BarcodeBackup WITH NO_LOG
  END
RESUME_NEXT:
  FETCH NEXT FROM csClearBarcode
  INTO
  @intClearID,@charMO
END
DUMP TRAN PTP WITH NO_LOG
DUMP TRAN BarcodeBackup WITH NO_LOG
EXIT_PROC:
CLOSE csClearBarcode
DEALLOCATE csClearBarcode
RETURN 0
ERROR_PROC:
CLOSE csClearBarcode
DEALLOCATE csClearBarcode
RETURN -1

GO