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)
 UDFs within Stored Procedures

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-02-17 : 08:17:43
Tony writes "I want to write a stored procedure which does multiple updates by passing a parameter into a function - (capitalise first letter of string)
How do I call a UDF within a stored procedure. Function is called initcap-See below

CREATE PROCEDURE Capitilise AS
Update Employee
set surname=initcap(surname)"

nr
SQLTeam MVY

12543 Posts

Posted - 2004-02-17 : 08:44:21
CREATE PROCEDURE Capitilise AS
Update Employee
set surname=dbo.initcap(surname)
go

or
update Employee
set surname = stuff(surname,1,1,upper(left(surname,1)))


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -