June 13, 2005 at 10:08 am
Hi,
I am using .Net to update a table in SQL Server 2000. One of the columns in the table is LastUpdateDate which is as it says! My stored procedure sets the datetime to go in here using GetDate(). My question is how do I get this value back (without having to read from the table again, if poss.) I tried using an output parameter but I get an error. This is the vb.net code and a bit of the sp.
'Add parameter for returning UpdateDate: @UpdateDate
dim prmUpdateDate as New SQLParameter()
prmUpdateDate.Direction = ParameterDirection.Output
prmUpdateDate.ParameterName = "@UpdateDate"
cmdUpdate.Parameters.Add(prmUpdateDate)
...
Stored Proc
...
As
DECLARE @UpdateDate DateTime
SET @UpdateDate = GetDate()
UPDATE CAPA_MAIN ....LastModifyDate = @UpdateDate...
RETURN
June 13, 2005 at 10:12 am
Create proc .... @UpdateDate output = GetDate()
then supply a null value when you create this parameter... You should be fine this fine.
June 13, 2005 at 10:27 am
Perfect!
Thanks again for your help (for the second time today!!)
June 13, 2005 at 11:21 am
HTH, again .
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply