I have an SQL Function that takes a String, a DATE and another string.
EXEC dbo.ReplaceString 'You ve been subscribed to the ##company## newsletter.',
NOW,'BIG DEES'
CREATE Function [dbo].[ReplaceString]
(
@main_message As Varchar(500),
@date_sent As DateTime,
@company As Varchar(30)
)
RETURNS VARCHAR(650)
AS
BEGIN
RETURN(@main_message)
END
Problem is when I try to execute this function, even after commenting out all code processing logic in my function, I get the error
Error converting data type nvarchar to datetime.
I am not doing any data access of any kind in the function. All I have is code to process the string using the other information passed in.Anyone have an idea of what this problem could be from and how I can fix it?
http://msdn.microsoft.com/en-us/library/ms189915.aspx