GetDate() in Stored Procedure
-
I have a stored procedure that updates data in one table and saves who updated it and the update date in another table. For some reason, the user ID is updating, but the date isn't. I'm using the
GetDate()
function, so it should work fine, as far as I know. It's like the update statement doesn't even recognize the second column. Before you ask, I know the SQL is correct. In fact, if I execute the stored procedure from QA, everything works fine. Are there any issues with using theGetDate()
function in a stored procedure? I wouldn't think there are. Here's my SQL:UPDATE UserDefinedRows
SET UpdatedByUserId = @UserID,
UpdateDate = GETDATE()
WHERE UserDefinedRowID = @UserDefinedRowIDMichael Flanakin Web Log
-
I have a stored procedure that updates data in one table and saves who updated it and the update date in another table. For some reason, the user ID is updating, but the date isn't. I'm using the
GetDate()
function, so it should work fine, as far as I know. It's like the update statement doesn't even recognize the second column. Before you ask, I know the SQL is correct. In fact, if I execute the stored procedure from QA, everything works fine. Are there any issues with using theGetDate()
function in a stored procedure? I wouldn't think there are. Here's my SQL:UPDATE UserDefinedRows
SET UpdatedByUserId = @UserID,
UpdateDate = GETDATE()
WHERE UserDefinedRowID = @UserDefinedRowIDMichael Flanakin Web Log
Oh, and when the SP gets run from the application, it gets run by a DBO user. Michael Flanakin Web Log
-
Oh, and when the SP gets run from the application, it gets run by a DBO user. Michael Flanakin Web Log
I just logged into QA as the user the application is running as and the SP executed fine. I'm still having problems when executing it from the app, tho. This is pretty ridiculous. Michael Flanakin Web Log
-
I have a stored procedure that updates data in one table and saves who updated it and the update date in another table. For some reason, the user ID is updating, but the date isn't. I'm using the
GetDate()
function, so it should work fine, as far as I know. It's like the update statement doesn't even recognize the second column. Before you ask, I know the SQL is correct. In fact, if I execute the stored procedure from QA, everything works fine. Are there any issues with using theGetDate()
function in a stored procedure? I wouldn't think there are. Here's my SQL:UPDATE UserDefinedRows
SET UpdatedByUserId = @UserID,
UpdateDate = GETDATE()
WHERE UserDefinedRowID = @UserDefinedRowIDMichael Flanakin Web Log
UpdateDate = GETDATE() please past the error message hint, if UpdateDate is datatime then it will work properly. Qaisar Mehmood Mughal ............................................................................... May Allah gave u success in all fields of life. (Aameen) ............................................................................... Software Engineer ISF - Islamabad Software Factory 3rd Floor, Software Technology Park Constitution Avenue, Islamabad 44000, Pakistan www.isf.com.pk qaisar@isf.com.pk , qmmughal@gmail.com Phone: +92 (51) 2825387 : 0321-5226623