問題が発生しているT-SQLコードは次のとおりですdatetime
OPEN @form_dates
FETCH NEXT FROM @form_dates INTO @cid、@regdate、@compdate/* PRINT @regdate PRINT @compdate これは日時に正しく値を持っています。例: 2012 年 3 月 28 日 6:03PM PRINT@コースノ */
@@FETCH_STATUS = 0の間 始める SET @SQL = N'update tblname set cs' + CAST (@cid AS VARCHAR(10)) + '_begin = @rstring , cs' + CAST (@cid AS VARCHAR(10))+ '_end = @cstring where UserID = '+ CAST (@tempID AS VARCHAR(10))
DECLARE @ParmDefinition nvarchar(500) SET @ParmDefinition = N'@rstring 日時、@cstring 日時'
EXECUTE sp_ExecuteSQL @SQL、@ParmDefinition、 @rstring = @regdate、@cstring = @compdate
I have the values of
@regdate
and@compdate
fetched from a cursor and are of the format Jan 3 2012 2:30PM Mar 28 2012 6:03PM but these values are not reflecting in procedure output where I get the output:update tblname set cs32_begin = @rstring , cs32_end = @cstring where UserID = 419
ありがとう。^