Positioned Updates with Transact-SQL
From: Rea Peleg (reapeleg_at_barak-online.net)
Date: 04/07/04
- Next message: ccallen: "Re: using convert in xp_sprintf"
- Previous message: TS: "Re: Table design for field that can contain multiple values"
- Next in thread: J. M. De Moor: "Re: Positioned Updates with Transact-SQL"
- Reply: J. M. De Moor: "Re: Positioned Updates with Transact-SQL"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 7 Apr 2004 21:47:52 +0200
Hey EB
Can any one replace the sql update sentence below, using a positioned update
with the cursor
that is already in use??
I can't get the right syntax for using the 'WHERE CURRENT OF' clause..
TIA
Rea
////////////////////////////////////////////////////////////////////////////
///////////////
SELECT sales_date_vc FROM dates_values
For update of sales_date
OPEN dates_cursor
FETCH NEXT FROM dates_cursor
INTO @vr_date
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @d_date = convert(datetime,@vr_date,120)
--============================================
update sales_date_vc set sales_date = @d_date
where sales_date = @vr_date
--============================================
FETCH NEXT FROM dates_cursor INTO @vr_date
END
- Next message: ccallen: "Re: using convert in xp_sprintf"
- Previous message: TS: "Re: Table design for field that can contain multiple values"
- Next in thread: J. M. De Moor: "Re: Positioned Updates with Transact-SQL"
- Reply: J. M. De Moor: "Re: Positioned Updates with Transact-SQL"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|