-- DECLARE VARIABLE AS INT
DECLARE @PRODUCTID AS INT
DECLARE SQLCURSOR CURSOR FOR
SELECT PRODUCTID FROM TBLPRODUCTMASTER
-- DECLARE CURSOR FOR SELECTED PRODUCTID
-- I HAVE ONE TABLE NAMED TBLPRODUCTMASTER AND I AM GETTING ALL PRODUCTID FROM THIS TABLE AND PRINT INDIVIDUAL PRODUCTID
OPEN SQLCURSOR
FETCH NEXT FROM SQLCURSOR INTO @PRODUCTID
WHILE(@@FETCH_STATUS=0)
BEGIN
PRINT @PRODUCTID
-- YOU CAN USE EACH PRODUCTID AND MAKE AN OPERATION ON THIS ID
FETCH NEXT FROM SQLCURSOR INTO @PRODUCTID
END
CLOSE SQLCURSOR
DEALLOCATE SQLCURSOR
Monday, December 1, 2008
LOOPING IN STORED PROCEDURE [CURSOR IN SQL SERVER]
at
5:05 AM
·
Category: SQL SERVER
Subscribe to:
Post Comments (Atom)
Archivo
-
▼
2008
(20)
-
▼
December
(14)
- Building Custom Control : Tell A Friend Custom Con...
- Watermark on image : Draw string on the image
- Remember me on this computer - Store username and ...
- Building URL with www.
- HIGHLIGHT STRING IN IMAGE [ DRAW STRING WITH HIGHL...
- LOOPING IN STORED PROCEDURE [CURSOR IN SQL SERVER]
- CHANGE IMAGE COLOR USING C# ( GRAPHICS GDI+ )
- DRAW STRING WITH MULTI LINES IN FIX RECTANGLE
- DRAW STRING WITH TWO LINES IN FIX RECTANGLE
- DRAW STRING IN FIX RECTANGLE WITH BACKGROUNG COLOR...
- DRAW STRING IN FIX RECTANGLE WITH BACKGROUNG COLOR...
- DRAW STRING IN FIX RECTANGLE WITH BACKGROUNG COLOR...
- DRAW STRING IN FIX RECTANGLE WITH BACKGROUNG COLOR
- DRAW STRING IN FIX RECTANGLE
-
▼
December
(14)
Categories
- Custom Control (1)
- Data Control (1)
- Graphics GDI+ (11)
- Other (6)
- SQL SERVER (1)
0 comments:
Post a Comment