UDF: allowed in one DB but not another???
Can someone help on this.
I've got a UDF Scalar Function that works fine in on database, but when I try to copy the same UDF to another database I get syntax error messages.
The function is:
ALTER FUNCTION dbo.GetDateFilled
Declare @dateFilled datetime
If @dateAt1 Is Not Null And @dateAt2 Is Null
set @dateFilled = @dateAt1
If @dateAt1 Is Null And @dateAt2 Is Not Null
set @dateFilled = @dateAt2
If @dateAt1 Is Null And @dateAt2 Is Null
set @dateFilled = @dateEndActual
Set @dateFilled = @dateAt1
And this isn't the only UDF I can't import from one DB to another. It seems that I can't import any???
Any ideas would be greatly appreciated: