Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 udf error

Author  Topic 

jung1975
Aged Yak Warrior

503 Posts

Posted - 2005-10-12 : 13:52:48
create function dbo.fn_FormatNames(@name as varchar(50) )
Returns varchar(50)

As
Begin
select @name = ltrim(rtrim(@name))
select @name = replace(@name,'II', '')
select @name = replace@name , 'III', '')

return @name
end


this gives me error:
A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations.
What am I doing wrong here?


tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-10-12 : 14:28:53
You are missing a left parenthesis in the third select statement.

Tara
Go to Top of Page
   

- Advertisement -